How display the List botton button only for particular Module

Bala13
Kilo Guru

Hello,

I have created a new Module under change managenet Menu, which will display only the change requests which are submitted for approval state.

I have created a UI action on change request form, this UI button i wanted to display like List bottom button.

But this button is now visible for all the change request modules like, open requests, closed requests.

I wanted to display it only for one module which i have created now.

find_real_file.pngfind_real_file.png

List view of newly created Module:

----------

find_real_file.png

 

List of view of OOB modules: Here that Notify button should not be visible

-----------------------------------------

find_real_file.png

1 ACCEPTED SOLUTION

Hi Lalitha,

it seems the UI action condition doesn't evaluate the url in condition field

https://hi.service-now.com/kb_view.do?sysparm_article=KB0681797

I have taken another approach and it is working fine and showing the button only when that module is opened

1) created UI script - notify_button

URL: https://dev59996.service-now.com/sys_ui_script.do?sys_id=3858001fdb1210108ab0a0f2ca96196d

2) in that added script to check the url contains the module sys_id or not

3) if not then hide that button using DOM

Note: this is not recommended

Regards
Ankur

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

View solution in original post

17 REPLIES 17

Hi Lalitha,

it seems the UI action condition doesn't evaluate the url in condition field

https://hi.service-now.com/kb_view.do?sysparm_article=KB0681797

I have taken another approach and it is working fine and showing the button only when that module is opened

1) created UI script - notify_button

URL: https://dev59996.service-now.com/sys_ui_script.do?sys_id=3858001fdb1210108ab0a0f2ca96196d

2) in that added script to check the url contains the module sys_id or not

3) if not then hide that button using DOM

Note: this is not recommended

Regards
Ankur

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

Hello Ankur,

Yes i checked and its working.

May i know, the explanation of this, since i never knew this, so wanted to understand how it is working.

 

Hi Lalitha,

You can create UI script & it will run on every page load.

From that you can handle such things

But it is not recommended to use large UI scripts as they may impact as they load on every page load

https://docs.servicenow.com/bundle/orlando-application-development/page/script/client-scripts/concep...

Regards
Ankur

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

Thank you Ankur.

Hello Ankur,

I have a doubt here. Actually the code is working as expected.

But i have one doubt, after writing the UI script, i can see there is  a difference in the script tab  in Business rule. Please tell me what should do to obtain it like as beforee. 

Kindly see the below screenshot

find_real_file.png