- 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 06:46 AM
Hi Shruthi,
UI Action conditions evaluate when form loads and it is not recommended to show/hide the UI action on change of some field using client script
But if you still require script you can refer below links
Note: this would use DOM manipulation
For the client script to work you will have to set Isolate Script field to false
By default that field is set to true; that field is not available on form but from list you can set it to false
Client script code to hide ui action
How to hide UI Action based on field change in form without using DOM?
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 06:53 AM
Hi,
I had been thru this post unfortunately I was not able to access the class name or the action name or the id . can you please me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 07:04 AM
Hi Shruthi,
Is this for native view or portal view?
please check the HTML element for that button
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:07 AM
Hi,
I did that and found the id and class name of that ui action by using document.getElementById() and Class but it didnot work