Client script with get reference is not working in workspace

akshaygadew
Tera Contributor

I have written a client script for work space using get reference which is working as expected , but in classic UI it is not working. do we need to create new client script for classic ui ?

7 REPLIES 7

akshaygadew
Tera Contributor

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var ref = g_form.getReference('priority', callBackFunc);

}
function callBackFunc(ref) {

g_form.setMandatory('description', true);
}

 

above script is working in workspace and not working in classic ui. What changes i need to do so that it will work for both.

Hi @akshaygadew , did you checked by selecting the UI as all in the client script.

Hi Anil , yes Ui is all in client script

Ankur Bawiskar
Tera Patron
Tera Patron

@akshaygadew 

in classic UI any UI policy is conflicting?

Also in your client script ensure Global checkbox is checked so that it runs in all the views.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader