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

Hello Harun

What is script incude and script include 2?

They are 2 script includes Ive made to return certain values and insert them in the sysparm_query. I instantiated them earlier in the in the script portion of the script for the UI Action assigned them to script include and scriptinclude2 variables and used them in that uri.set portion.

For example 

model_category=' + scriptInclude

This one would return model category based on the model category of the Catalog Item assigned in the RITM.

And this one

^stockroom.sys_idIN' + scriptInclude2

Would return an array of sys IDs that show stockrooms with the same company as the users(thats assigning the asset) group companies(here the sys_user_group table has a Company column)