How to apply the default filter in the list control while clicking the Edit button in the related list based on a particular role.

Anjana Suseela
Kilo Explorer

I have a default filter as below in my related list given using the list control option. My requirement is when i click on the "Edit" button in the related list, it should show the filter only for a certain role. And when an user with a manager role logs in this filter should not be applied. I have checked the "Omit filer condition" and added the below code to the filter condition as well. Still the people with the manager role has got this filter on.

Any idea on how to show this filter only for certain role.

if (gs.hasRole('xx') || gs.hasRole(xx)) {
answer = true;
} else {
answer = false;
}

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

when you set answer=true it would hide the filter

did you add logs in that script?

Regards
Ankur

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

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

when you set answer=true it would hide the filter

did you add logs in that script?

Regards
Ankur

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