How to restrict "NEW" button to a particular group only

VIKAS MISHRA
Tera Contributor

In the related list a can see the "NEW" button always visible , how to restrict that to only for a particular group only.

1 ACCEPTED SOLUTION

AndersBGS
Tera Patron
Tera Patron

Hi @VIKAS MISHRA , 

 

Please see article: https://www.servicenow.com/community/in-other-news/managing-the-new-and-edit-buttons-on-related-list... paragraph 5:

 

AndersSkovbjer_0-1678715300710.png

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

5 REPLIES 5

Hemant Goldar
Mega Sage
Mega Sage

Hi @VIKAS MISHRA,

 

Here is sample script you have to use to hide "NEW" Ui action in related list

var currentUser = gs.getUserID();
var group = 'IT Support'; // replace with the group name you want to hide the UI action for
var isMember = gs.hasRole(group) || gs.getUser().isMemberOf(group);

if (isMember) {
  return false; // hide the UI action
}

return true; // show the UI action

 

I hope this helps!

 

Regards,

Hemant 

**If my answer has helped with your question, please mark my answer as an accepted solution and give it a thumbs up.

**