- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:08 AM
Intro:
I am trying to add a filter for Edit.. button on a Related lists. This Edit.. button was coming as part of the newly created m2m relationship b/w 2 tables. Now, when I am trying to add the filter conditions via "Edit Default Filter" option in the sys_ui_control record.. it's only having very limited options. I am unable to add custom filter.
Also, User is able to remove this existing filter and can see all the values. It's not even read-only.
Does anyone know how to provide the custom filter conditions for his Edit... button ? Please leave your thoughts..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:59 AM
What you need to do is alter the UI Action for the Edit... record. Find the one for m2m then change the Script, or you can try first changing the table then doing an Insert and Stay to make a copy so that you're not changing the button for all m2m related lists. In any event you need to add 2 uri.set lines to set a default filter on the ensuing slushbucket, and to hide it so that it can't be altered.
uri.set('jvar_no_filter', 'true');
uri.set('sysparm_query', 'nameIN' + GlideStringUtil.join(tables) + '^sys_scope!=' + parent.sys_scope.toString());
sysparm_query can reference any number of things - a variable that calls a Script Include, encoded query,... this one is from an Edit UI Action in my PDI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:59 AM
What you need to do is alter the UI Action for the Edit... record. Find the one for m2m then change the Script, or you can try first changing the table then doing an Insert and Stay to make a copy so that you're not changing the button for all m2m related lists. In any event you need to add 2 uri.set lines to set a default filter on the ensuing slushbucket, and to hide it so that it can't be altered.
uri.set('jvar_no_filter', 'true');
uri.set('sysparm_query', 'nameIN' + GlideStringUtil.join(tables) + '^sys_scope!=' + parent.sys_scope.toString());
sysparm_query can reference any number of things - a variable that calls a Script Include, encoded query,... this one is from an Edit UI Action in my PDI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 02:58 AM
It worked. Very much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 04:42 AM
You are welcome!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 04:21 AM
Hi @Brad Bowman
I am trying to implement similar behavior in Configurable workspace as well.. The thing is when I am trying to select the record and save it. then it is not saving the records.
If you have came across any such issues.. please let me know