How to hide Display filter after clicking edit button in related list

Arkesh Kumar
Giga Guru

Hi,

 

I am looking to hide Display filter. any help?

 

find_real_file.png

Thank you,

Arkesh

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

UI Action based approach based on problem table which is related list on Incident table

1) Visit this OOB UI Action -> Edit on Global Table

URL: https://instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=7fff4c3d0a0a0b3400ad3f1a1d613f74

Update as this so that you create new button for your related list table

a) Action name - sysverb_edit_o2m_problem

b) Condition: (new GlideRecord(current.getTableName())).canWrite() && RP.isOneToMany() && !RP.getListControl().isOmitEditButton() && current.getTableName() == 'problem'

c) Script:

var uri = action.getGlideURI();
var path = uri.getFileFromPath();
uri.set('sysparm_m2m_ref', current.getTableName());
uri.set('sysparm_collection_related_file', current.getTableName());
uri.set('sysparm_form_type', 'o2m');
uri.set('sysparm_stack', 'no');
uri.set('sysparm_query', '');
uri.set('jvar_no_filter', 'true'); // added new
action.setRedirectURL(uri.toString('sys_m2m_template.do'));

d) Do Insert and Stay

2) Now Visit the Edit button which is OOB and update the condition as this so that the OOB button is not visible for your table

URL: https://instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=7fff4c3d0a0a0b3400ad3f1a1d613f74

Condition: (new GlideRecord(current.getTableName())).canWrite() && RP.isOneToMany() && !RP.getListControl().isOmitEditButton() && current.getTableName() != 'problem'

OOB UI Action After changes

find_real_file.png

New Edit button

find_real_file.png

Output:

find_real_file.png

Regards
Ankur

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

View solution in original post

18 REPLIES 18

Hello,

 

Is it possible to show the filtered user list even if the user does not have permission to the filter? What I mean is I need a filter on the user based o roles and have used it in the UI Action but itil users don't have access to the field roles on user table, so it gets converted to keywords and does not load all the result.

https://www.servicenow.com/community/developer-forum/how-to-put-a-sys-user-role-filter-to-the-result...

Hi Ankur,

 

Can we hide a part of filter e.g. 3 filters have been applied in the Edit UI Action, I want to hide or make only one filter read only, can we do this?

 

HarshaPandey_0-1665131072927.png

 

 

Thanks,

Harsha

I don't think so.

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

Thanks Ankur for replying. Requirement is Operational status is not retired filter should only be made invisible or read only (other filters should remain as it is) or either they should not be able to select retired cis in slushbucket. Could you please let me know how to achieve this. Can a business rule be written to abort action if users are selecting retired ci in slush bucket? 

 

Or can I remove retired choice itself from operational status filter in slushbucket?

HarshaPandey_0-1665140368480.png

 

 

Thanks,

Harsha