logo

NJP

Upgrade to Madrid Patch 2 if you are getting an onSubmit script error when updating a catalog task

Import · May 13, 2019 · article

Issue: When saving a catalog task, form will not save and seeing below errors in the form -

Error in the console log: Uncaught ReferenceError: g_ui_scripts is not defined

onSubmit script error: ReferenceError: g_ui_scripts is not defined:

function() {

saveAllSelected([ gel(id) ],[ gel(ref) ],',', '\\','--None--');

}

image

Reason : If a catalog item has "Email" or "URL" type variables then the related "Catalog tasks" cannot be updated if 'variable editor' is added to the form (which displays the "Email" or "URL" type variables). When saving or updating the form you will get the console error.

Steps to Reproduce:

1. Go to any catalog item and an "Email" or "URL" type variable2. Go to the workflow that is attached to the catalog item and add a "Catalog Task" activity3. Make sure to add the variables created in step 1, in the "Add Variables" section on the "Catalog Task" workflow activity4. Order the item 5. Open the catalog task and make sure that "Variable Editor" is added to the form

6. Try to save the form

View original source

https://www.servicenow.com/community/itsm-blog/upgrade-to-madrid-patch-2-if-you-are-getting-an-onsubmit-script/ba-p/2293769