Hide/Show UI Action using UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:06 AM
Hi Everyone,
I want to hide/show UI Action using UI Policy. If status of record is deleted then it should hide UI action otherwise it should be visible.
UI Action:
Name = Knowledge Article
Action Name = instruct_knowledge
I used above method, somehow it is not working.
cc: @Ankur Bawiskar @kamlesh kjmar
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:26 AM - edited 11-15-2022 01:29 AM
Hi @Abhijit Das7 ,
Do not use DOM manipulation it is not a recommended practice. Use the condition of your UI action to control visibility of button on form. Below is an example, where I have a UI action 'My Button' which will hide if state of incident is 'Closed' else it will show for all other states.
In your case select your table and put in the status logic accordingly. Your condition in condition field of UI action should be something like:
current.your_status_field_name != 'value_of_deleted_option'
I hope this helps.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:28 AM
My requirement is to get it through UI Policy. I know I can achieve this using Condition field in UI Action. But please help me in above code.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:27 AM
Using DOM manipulation is not recommended.
But if you still want to use then ensure Isolate Script field on UI policy is False
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:33 AM