How to hide the New button in the Teams related list for non-admin users on Service/Service Offering

muskanattar
Tera Contributor

Hello Community,

 

On the Service and Service Offering records, there is an OOTB related list called Teams.

 

In this Teams related list, the New (and Edit) buttons behave as follows:


• For admin users, the New and Edit buttons are visible and records can be created/edited as expected
• For non-admin users, clicking the New button opens the record in read-only mode

 

Our requirement is to hide the New (and Edit) buttons completely from the form UI for non-admin users on the Service and Service Offering tables, instead of showing the button and opening a read-only form.

 

What we have tried:
• Implemented Omit Rules on the related list, but the New button is still visible
• Checked form-level configurations, but could not suppress the button

 

Requirement:
• Hide the New buttons in the Teams related list for non-admin users
• Apply this only on Service and Service Offering forms

 

Could you please advise:
• Whether this behavior is controlled via ACLs, UI Actions, Related List properties, or OOTB CSDM logic
• The recommended technical approach to hide these buttons at the form / related list level.

 

Any technical guidance or best practices would be appreciated.

 

Thank you.

10 REPLIES 10

Ankur Bawiskar
Tera Patron

@muskanattar 

simply give in New role field the admin role and no scripting required

AnkurBawiskar_0-1770621177673.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

muskanattar
Tera Contributor

Hi @nayanmule and @Ankur Bawiskar ,

 

I checked your suggestion by declaring the user value and assigning only the admin role. However, I’m still not getting the expected result. The new button is still visible in the related list for non-admin accounts.

 

 
var user = gs.getUser();
var answer = true;
if (!user.hasRole('admin')) {
   answer = false;
}

@muskanattar 

so even after giving admin in New roles it's still showing for non-admin?

no scripting required.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar ,

 

Yes correct, even after giving admin in New roles it's still showing for non-admin.

@muskanattar 

then ensure Table.None CREATE ACL on that related list table has role as admin

OR

Use this script in Omit new condition

answer = !gs.hasRole('admin'); // if true means omit if false means don't omit

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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