UI Action Visibility Issue: Hide button in CMDB WS while keeping it visible in Asset WS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I am facing an issue managing UI Action visibility when a user navigates between different Workspaces (Asset Workspace and CMDB Workspace). I need to find a way to dynamically hide the action based on the active Workspace.
- Environment Context
Table: Configuration Item [cmdb_ci]
Configuration: Client checkbox selected
Goal: The UI Action is displayed in the Asset Workspace. Upon clicking, it should open the current record within the CMDB Workspace. Once the record is opened in the CMDB Workspace, the button must disappear to prevent the user from opening the same page repeatedly. - Problem Description
The UI Action remains visible even in the CMDB Workspace. Consequently, if the user clicks the button again from the new tab, the system opens another identical tab. - Current UI Action Condition
gs.hasRole("sn_cmdb_user") && (RP.getReferringURL() != null && RP.getReferringURL().indexOf('/now/cmdb/') == -1)- Script Client Side
function onClick(g_form) {
var sys_id = g_form.getUniqueValue();
var table = g_form.getTableName();
var url = "/now/cmdb/record/" + table + "/" + sys_id;
top.window.open(url, "_blank");
}
Labels:
- Labels:
-
Workspace : Next Experience
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
did you try to use action exclusion and try to remove it from CMDB workspace?
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
