- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 06:43 AM
Hi,
I have to hide a Ui action on the change form on change of the configuration item. How do I refer to the UI action in the on change client script of the configuration item field.Please help me out
Thanks,
Shruthi.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 07:37 AM
Hi Shruthi,
Did you set this field to false?
Isolate Script - false
- This field is not on form but from list you can make it false
- by default it is true
- If that is true DOM won't work
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 07:37 AM
Hi Shruthi,
Did you set this field to false?
Isolate Script - false
- This field is not on form but from list you can make it false
- by default it is true
- If that is true DOM won't work
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:12 AM
Hi,
I have tried this still it throws an error saying onChange script error: TypeError: document.getElementByID is not a function
Isolate script set to false
Client Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var data = g_form.getValue('cmdb_ci');
var agg = new GlideRecord('cmdb_ci');
agg.addQuery('sys_id', data);
// agg.addAggregate('COUNT', 'sys_class_name');
agg.orderBy('sys_class_name');
agg.query();
while (agg.next()) {
var name = agg.getValue('sys_class_name');
//alert(name);
}
//alert(data);
var link = document.getElementById('8b6441e5db629410a2c89cd5ca9619b2');
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:13 AM
I am unable to disable it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:14 AM
where are you testing it ? native UI ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:19 AM
writing glide record in client script is not good approach. also i would suggest to avoid DOM as much as possible.