Client script with get reference is not working in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 12:47 AM
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 12:56 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 01:14 AM
Hi @akshaygadew , did you checked by selecting the UI as all in the client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 06:18 AM
Hi Anil , yes Ui is all in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 06:28 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader