Skip to main content

Posts

Showing posts from November, 2023

ServiceNow Scripts and Engines Execution Order

 ServiceNow Scripts and Engines Execution Order Helpful article when troubleshooting Stage change issues:  Scripts and engines execution order docs.servicenow.com Scripts and engines execution order Scripts, assignment rules, business rules, workflows, escalations, and engines all take effect in relation to a database operation, such as insert or update. In many cases, the order of these events is important.

ServiceNow RECORD PRODUCER VARIABLES

ServiceNow RECORD PRODUCER VARIABLES  OPTION 1: var allVars = []; var sys_id = '14d3ca4b1b2ebd50af03dce0b24bcbfc' ; var producerVars_allVars = new GlideRecord ( 'question_answer' ); producerVars_allVars . addQuery ( 'table_sys_id' , sys_id ); producerVars_allVars . addQuery ( 'question.type' , '!=' , 11 ); producerVars_allVars . addQuery ( 'question.type' , '!=' , 19 ); producerVars_allVars . addQuery ( 'question.type' , '!=' , 20 ); producerVars_allVars . query (); while ( producerVars_allVars . next ()) { var varName = producerVars_allVars . question . name . toString (); if (! gs . nil ( varName )) { //if (varName == 'business_role_iga') { var sVar =( 'VARIABLE NAME: ' + producerVars_allVars . question . name . toString () + ' \nVARIABLE VALUE=' +

ServiceNow Get Variable Name in Business Rule (Record Producer or Service Request)

 ServiceNow Get Variable Name in Business Rule (Record Producer or Service Request) current.variables.<variable_name>  for a record producer where you don't know the variable names this type of approach could work: /*var producerVars_allVars = new GlideRecord('question_answer'); producerVars_allVars.addQuery('table_sys_id', current.sys_id); producerVars_allVars.addQuery('question.type', '!=', 11); producerVars_allVars.addQuery('question.type', '!=', 19); producerVars_allVars.addQuery('question.type', '!=', 20); producerVars_allVars.query(); while (producerVars_allVars.next()) { var varName = producerVars_allVars.question.name.toString(); if (!gs.nil(varName)) { if (varName == 'business_role_iga') { sDescr += '\n'; sDescr += 'varName'; sDescr +=

ServiceNow Submit Button was not appearing on portal catalog item

 ServiceNow Submit Button was not appearing on portal catalog item I found this post useful: https://www.servicenow.com/community/developer-forum/no-submit-button-in-catalog-item-view/m-p/1823356 steps: 1) Go to Maintain Items i,e the Catalog Item Table for your particular Catalog Item 2) Please pull these columns from the personalized gear  No Cart, No Order, No order Now, No Proceed to checkout 3) Make sure all these are False. Check if this resolves your problem.

ServiceNow use Google Chrome Extension to show instance environment

 ServiceNow use Google Chrome Extension to show instance environment environment marker extension see  https://chrome.google.com/webstore/detail/environment-marker/ahjhdebcnlgmojdmjnhikhakkghcchkk

ServiceNow Error: Create operation from scope 'rhino.global' has been refused due to the table's cross-scope access policy

ServiceNow Error: Create operation from scope 'rhino.global' has been refused due to the table's cross-scope access policy Sometimes if encountering an issue in background script or fix script, move the code into a script include defined within the application but accessible from all application scopes, and call the script include from there example - background script: var firstname = 'testfirst' ; var lastname = 'testlast' ; var title = 'Mr' ; var si = new x_cls_clear_skye_i . serviceCatalog_libraries (); var res = si . createTestStagingEntry ( firstname , lastname , title ); gs . print ( 'RECORD SYSID=' + res ); script include: createTestStagingEntry : function ( firstname , lastname , title ) { var startdate = new GlideDate (). getDisplayValue (); var gr = new GlideRecord ( 'x_cls_clear_skye_i_poc_account_import_staging' ); gr . newRecord (); gr . setValue ( 'u_first_name'