Need to hide Ui actions OOB Closed Complete & Closed Incomplete on HR Agent Workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 12:52 AM
Hi All,
I have a requirement to hide the closed Complete and Closed incomplete on agent workspace for particular HR service.
I have tried the below and it is hiding on Native Ui but not on Agent Workspace.
For our UI action name "Closed Complete". In order to hide both the top and bottom UI actions. We need to input the following into the corresponding UI policy "Execute if True" and "Execute if False" fields.
Execute if True:
function onCondition() {
$j('[data-action-name=closedComplete]').show();
}
Execute if False:
function onCondition() {
$j('[data-action-name=closedComplete]').hide();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 06:51 AM
why not add the condition in UI action condition field?
Why to use UI policy?
Your UI policy is using DOM manipulation which is not allowed in agent workspace
the buttons in agent workspace are not rendered via UI action table
those are present in UX Form Actions table (sys_ux_form_action)
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-08-2024 08:34 AM
@Ankur Bawiskar ,
Thank for the information, just thought of asking is there any possible way to hide the Ui Action apart from UI Action Conditions.
I hope there is no other way to hide Ui Action apart from adding conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 08:09 PM
I already shared the logic above
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader