UPDATE ALL / UPDATE SELECTED context menu

Lana2xp
Tera Contributor

Hello guys ,

how to insert this option on context menu incidents list for itil and itil_admin users ??

How to script this ?

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi,



You need to Navigate to "Ui Context Menu" under System UI and search for Name ="Update All" as shown below:



find_real_file.png



The above UI Context Menu is for the Global Table which means it is available for all the Table for Users having Role as "list_updater" as shown below:



find_real_file.png



SO in Order to make this available for ITIL Users then we need to Update the Condition highlighted above as below:



(gs.hasRole('list_updater')   || gs.hasRole('itil'))   && !ListProperties.isRelatedList() && !RP.isPortal() && !ListProperties.isRefList()




find_real_file.png



But this would be a Global Change making the Update All Context menu available for the ITIL USers on all the Table. Now if you want to make it available only for Incident Table then you need to overiride the above Context Menu for the Incident Table as mentioned Below:



1) Create a new UI Context Menu with the same script and the condition as shown below for the Incident Table:



find_real_file.png



Now once this new UI Context Menu has been created, you need to make the OOB UI Context Menu "Update All" unavailable for Incident Table other wise two Update All Context Menu would be visible for the users. So Navigate to the OOB UI Context Menu "Update All" and update the conditions as below:



(gs.hasRole('list_updater') || gs.hasRole('itil'))   && !ListProperties.isRelatedList() && !RP.isPortal() && !ListProperties.isRefList() && current.sys_class_name!='incident'




find_real_file.png



Similarly it can be done for Update Selected Context Menu.



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

5 REPLIES 5

Bharath40
Giga Guru

Hi Ehasebe,



If you are on Istanbul refer to this article Edit multiple records in a list using an editing form   also check this for other versions Editing Lists - ServiceNow Wiki


shloke04
Kilo Patron

Hi,



You need to Navigate to "Ui Context Menu" under System UI and search for Name ="Update All" as shown below:



find_real_file.png



The above UI Context Menu is for the Global Table which means it is available for all the Table for Users having Role as "list_updater" as shown below:



find_real_file.png



SO in Order to make this available for ITIL Users then we need to Update the Condition highlighted above as below:



(gs.hasRole('list_updater')   || gs.hasRole('itil'))   && !ListProperties.isRelatedList() && !RP.isPortal() && !ListProperties.isRefList()




find_real_file.png



But this would be a Global Change making the Update All Context menu available for the ITIL USers on all the Table. Now if you want to make it available only for Incident Table then you need to overiride the above Context Menu for the Incident Table as mentioned Below:



1) Create a new UI Context Menu with the same script and the condition as shown below for the Incident Table:



find_real_file.png



Now once this new UI Context Menu has been created, you need to make the OOB UI Context Menu "Update All" unavailable for Incident Table other wise two Update All Context Menu would be visible for the users. So Navigate to the OOB UI Context Menu "Update All" and update the conditions as below:



(gs.hasRole('list_updater') || gs.hasRole('itil'))   && !ListProperties.isRelatedList() && !RP.isPortal() && !ListProperties.isRefList() && current.sys_class_name!='incident'




find_real_file.png



Similarly it can be done for Update Selected Context Menu.



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Lana2xp
Tera Contributor

Hey thanks so much ,you saved my life today ! haha


Julian Hoch
ServiceNow Employee
ServiceNow Employee

This answer is actually incorrect or at least not best practice.


Instead of modifying the out of the box context menu (which impacts your upgrades), what you should do instead is assign the users (or the respective groups) the role "list_updater". Alternatively you could add the "list_updater" role to the "itil" role, but in general it's better to add it to your groups (unless there are many groups with the "itil" role).