How to apply a default filter on a Related list and "lock" it so users cannot change it

PaulaaO
Mega Sage

Hi Community,

 

I need to apply a default filter on a related list which I managed to do (used the Set as default filter option from

Solved: How to set Default Filter on related list for all ... - ServiceNow Community ), however I have the requirement to "lock" this filter so it cannot be removed by users, but allow them to keep on building the filter if they want to.

 

I've tried various combinations from List Layout control such as omit filter or restrict the filter by roles, but in most cases I only manage to make the filter icon unavailable.

 

Is this possible at all?

 

Thank you.

 

Paula

1 ACCEPTED SOLUTION

This will re-create the out of box filter:

current.addEncodedQuery('top_task=' + parent.sys_id);

so it looks like the full one would be:

current.addEncodedQuery('top_task=' + parent.sys_id + '^u_dependency_typeINinternal,external,3rd_party,other');

'parent' here refers to the pm_project table record.

 

View solution in original post

7 REPLIES 7

This will re-create the out of box filter:

current.addEncodedQuery('top_task=' + parent.sys_id);

so it looks like the full one would be:

current.addEncodedQuery('top_task=' + parent.sys_id + '^u_dependency_typeINinternal,external,3rd_party,other');

'parent' here refers to the pm_project table record.

 

that worked!! thank you @Brad Bowman  learned something new today 🙂

 

For anybody who might find this useful, this is the final version of the relationship record: 

PaulaaO_0-1736432205668.png

You are welcome!

 

 

Connect with me https://www.linkedin.com/in/brad-bowman-321b1567/