How to hide/show ui action button based on modules which is linked to the same table

kalyani23
Tera Contributor

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

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

those buttons are on form or on list?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 

those buttons are on list

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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