Skip to main content

Posts

Showing posts with the label service catalog

ServcieNow Getting Record Producers - Simple v Comples

 var recSYSID = '1ba630c0c301c3105c97bdac050131a5'; var table = 'x_cls_clear_skye_i_group_operations'; getVarsSimple(recSYSID,table); getVarsComplex(recSYSID,table); function getVarsSimple(recSYSID, table) {   var now_GR = new GlideRecord(table);   gs.info('getvars SIMPLE:');   if (now_GR.get(recSYSID)) {     var variables = now_GR.variables.getElements();     for (var i = 0; i < variables.length; i++) {              var question = variables[i].getQuestion();       if (!gs.nil(question)&&question!=''){       gs.info('VARIABLE NAME:' + question.getLabel() + ", VARIABLE VALUE:" + question.getValue());       }     }   } } function getVarsComplex(recSYSID, table) {   var producerVars_allVars = new GlideRecord('question_answer');   producerVars_allVars.addQuery('table_sys_id', recSYSID);   //producerVars_allVars.addQuery('question.ty...

ServiceNow Grant flow in application scope permission to create catalog tasks (error 'scope does not have create access to table sc_task')

 ServiceNow Grant flow in application scope permission to create catalog tasks if your flow is throwing an error: scope does not have create access to table sc_task follow the steps outlined here: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0854565 - go to sys_scope_privilege and create a new record - source scope: the application scope - target scope: global - target name: sc_task - target type: table - operation: create - status: allowed also you can ensure the flow is set to run as system user in the flow properties

How to edit Order Confirmation Widget for Service Portal

How to edit Order Confirmation Widget for Service Portal   https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723600 Navigate to "Service Portal" > "Widgets" in the left side pane of your instance and select "Catalog Checkout" lone the Catalog Checkout widget and give it a unique ID and name Make any edits needed to this cloned widget (html, css, js etc...) and save. Clone the "SC Catalog Item" widget (since this is what calls the checkout widget modal) and give it a unique ID and name In this cloned widget, do a search for "sc-checkout" (2 entries) and replace those values with the id of the cloned "Catalog Checkout" widget. It should be in the "server script" portion Edit the Service Portal page, "sc_cat_item" in the page designer to replace the "SC Catalog item" widget with the new cloned version.

ServiceNow Create Clickable URL Link in Portal Page (Catalog Item) - internal link or external link?

  ServiceNow Create Clickable Link in Portal Page (Catalog Item) To create a clickable link within a ServiceNow portal catalog item, use a " Rich Text Label " variable type, allowing you to embed HTML and create a hyperlink using the  <a href>  tag for an external link , if you find that by default it is appending the instance url as a prefix to the external url resulting in a broken link, then modify the HTML  of the Rich Text Label (via the editor) and change it as follows: <p><span style="font-size: 12pt;"><a href= https://www.google.com   target="_blank" rel="noopener noreferrer nofollow" >Information page</a></span></p>

Why is oldvalue not accessible in a catalog client script?

  Apparently OldValue is the value the field held on initial load, and not updated for each time the onChange client script runs (i.e. each time you change the selection). see  https://www.servicenow.com/community/developer-forum/how-to-get-oldvalue-in-an-onchange-catalog-client-script/m-p/1761324 https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0711972

ServiceNow Submit a Request Using Cart API - 2 Approaches

ServiceNow Submit a Request Using Cart API - 2 Approaches 1) cart_api object 2) using table api -- var instName = gs.getProperty( 'instance_name' ); if (instName == 'xxdev' || instName == 'xxdev2' ) {     submitRequest(); //--CART API     //submitRequest_tableapi(instName); //--TABLE API - useful to target a remote instance }   function submitRequest() {     var sRequestedFor = gs.getUserID();     var sApplicationName = 'test_app' ;     var sEnvironment = 'DEV' ;     var sMetaData = '' ;     var sOwnerEmails = 'test@test.com' ;     var sTenantID = xxxxx-4718-4590-a921-xxxxxxxxx ;     var sReplyURL = 'www.test123.com' ;     var sManager = 'bfdb471e1b3931500b2c2f876e4xxxxx' ;       var sAppDescription = 'test-1234' ;     var sURL_1 = 'www.test456.com'       var cart = new sn_sc. CartJS (); ...