How to hide/show ui action button based on modules which is linked to the same table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 11:23 PM
Hi,
I want to show /hide ui actions that I have created based on modules. I have created table with name request , and with modules my request, assigned to me. So here I want to show by buttons in the my request module and to hide it in assigned to me module. please provide solution if it is doable
Thanks & Regards,
Kalyani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 11:31 PM
Hi,
those buttons are on form or on list?
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-03-2022 11:31 PM
Hi Ankur,
those buttons are on list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 11:36 PM
Hi,
in the UI action condition you can search if the module sysId is present in URL or not
something like this
Give the module sysId of "my request" here to show that button only in the list when opened from that module
sys_app_module -> take sysId from this table
gs.action.getGlideURI().toString().indexOf('sysparm_userpref_module=moduleSysID') > -1
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-04-2022 12:11 AM
I tired to give this conditon, now the button got disappeared in all the modules,
gs.action.getGlideURI().toString().indexOf('sysparm_userpref_module=438a00e41b441110826d42a6bc4bcb30') > -1
can u please tell me , is there any error here in this