How to make most of the "Edit Default Filter" choices read only?

harun_isakovic
Mega Guru

Hello Community,

I have some specific filters that I need to apply to these 3 workflows:

1. New Computer

2. New Peripheral

3. New Consumable

 

All 3 of these workflows interact with Assets on the RITM table. On RITM form there is a related list called "Assets" where we tie the assets to the RITMs.

find_real_file.png

When I click on the Asset RL and click Edit to assign an asset to this RITM I want some specific filters to appear there:

find_real_file.png

I know how to make all of the filters completely hidden but that's not what I am trying to achieve. I want the top 2 filters to be set as "read only" so no-one can edit them, and the bottom one I only want the Asset Manager to be able to change it.

Anyone knows how I can achieve this?

Thanks in advance.

1 ACCEPTED SOLUTION

harun_isakovic
Mega Guru

If you restrict the filter to roles, the filter will be read only for everyone except users with that specified role.

If you want to completely restrict the filter, the way I did it in this specific case was went into the "Edit..." UI Action for the Asset related list and added "uri.set('jvar_no_filter', 'true');" to the script of it. This hid the whole filter from the Slushbucket window, and then I just used a fixed query ex. 

uri.set('sysparm_query',model_category=' + scriptInclude + '^stockroom.sys_idIN' + scriptInclude2 + '^install_status=6^substatus=available');

View solution in original post

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

You can restrict list filter with fixed queries.

In your case, you can build fixed query for asset related list with state and substate fields.

 

Check below for fixed queries.

 

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/list-administrati...

 

Regards,

Sachin

How do I make this Query work for the slushbucket page?find_real_file.png

Nikhil Phalke
Kilo Guru

Hi,

 

Please go through below link it will help you.

https://community.servicenow.com/community?id=community_question&sys_id=9ebc4fe5db9cdbc01dcaf3231f96...

 

Regards

Nikhil

harun_isakovic
Mega Guru

If you restrict the filter to roles, the filter will be read only for everyone except users with that specified role.

If you want to completely restrict the filter, the way I did it in this specific case was went into the "Edit..." UI Action for the Asset related list and added "uri.set('jvar_no_filter', 'true');" to the script of it. This hid the whole filter from the Slushbucket window, and then I just used a fixed query ex. 

uri.set('sysparm_query',model_category=' + scriptInclude + '^stockroom.sys_idIN' + scriptInclude2 + '^install_status=6^substatus=available');