Hide "New" button from List based on Module name

varadharaj_a
Kilo Contributor

Hi,

I would like to hide "New" button from "All" list based on the Module Name.

For exaample, if the module name is "My Incidents",   it will show all my incidents with "New" button as list view by clicking on it.

But, this New button should not be displayed if it is under "My Incidents" list.

Could anyone help in this?

thanks

VG

1 ACCEPTED SOLUTION

Sorry, one correction in my reply



if RP.getParameterValue('sysparm_userpref_module') =='sys_id'


{


    return false


}


else


{


    if (Existing condition value of New button)


          return true


    else


          return false


}



regards


View solution in original post

8 REPLIES 8

Sai Anna
ServiceNow Employee
ServiceNow Employee

We can do this by Views, have a separate view for My Incidents and add a condition on UI Action to show only for certain views



please refer for getting view name in UI Action How to get View Name on Server side UI ACtion .


Shishir Srivast
Mega Sage

Please have below useful link.



you cam modify the UI Actions to disable the New button.



Using Access Control Rules - ServiceNow Wiki


Restrict or hide NEW button on incident list by roles doesn't work


Hi Shishir.



thanks for your help.



we have a separate UI action to show this "New" button in the list. if set active is false, then this new button does not display to all modules (showing List) related with this "Incident" application.


I would like to hide this "New" button for a particular module say "My incidents".


Can I get the current module name in the "UI Action"? if yes, this can be used as condition to show / hide this button.



thanks


VG


Put RP.getParameterValue('sysparm_userpref_module') == 'ID for module' in the condition statement...