Client Script Error

rutujalande
Tera Contributor

I am getting below error when submitting the catalog item request on the RITM Page on the requested for field.

 

onChange script error: TypeError: Cannot read properties of undefined (reading 'process') function(control, oldValue, newValue, isLoading) { window.CatalogDynamicValue.process(control, oldValue, newValue, isLoading, '130185880fa17500dcc800dce1050e09', '["d9646b46db5fc25085397856f3961964"]', false); }

10 REPLIES 10

Tanushree Maiti
Tera Patron

Hi @rutujalande 

 

From your 121256.png screen shot, it seems call back function is missing in your getReference method.

syntax should be

g_form.getReference(fieldName, callBackFunction);

 

Sample Script to set manager :   Can you try with it. 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

     if (isLoading || newValue === '') {

        return;

    }

    var userRef = g_form.getReference('requested_for', setManager);

}

 

function setManager(userRef) {

    if (userRef) {

        g_form.setValue('manager', userRef.manager);

    }

}

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti