- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 07:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 10:57 PM
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
New Edit button
Output:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 08:46 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 01:24 AM
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?
Thanks,
Harsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 02:16 AM
I don't think so.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 03:59 AM
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?
Thanks,
Harsha