- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 05:15 AM
Looking for advice on best practice regarding UI actions
Requirement: Remove 'Add to visual task board' UI action from context menu in a change request.
This UI action is defined against the 'task' table. We don't want to remove it from anywhere else. I know of a number of ways to achieve this but have been unsure whether there's a 'best practice' way or at least a ServiceNow recommended way.
Options (that I know of):
1. Add extra condition to existing task-based UI action - current.sys_class_name != 'change_request'
2. Duplicate the UI action, set the new record to active= false and use the 'overrides' field to specify the original action to override
3. Duplicate the UI action, set the new record to active = false and give it a lower order value whilst maintaining the same action name (and adding a unique one to both records if empty)
4. Duplicate the UI action, set the new record to active = false and set the table to change_request whilst maintaining the same action name (and adding a unique one to both records if empty)
5. Duplicate the UI action, set the new record to condition = false and use the 'overrides' field to specify the original action to override
6. Duplicate the UI action, set the new record to condition = false and give it a lower order value whilst maintaining the same action name (and adding a unique one to both records if empty)
7. Duplicate the UI action, set the new record to condition = false and set the table to change_request whilst maintaining the same action name (and adding a unique one to both records if empty)
Notes/Observations:
- Option 1 seems simplest but amending an OOTB ui action ultimately causes more work during system upgrades. It can also have a horrible impact in a qualified and validated environment as you're potentially amending something which is used by multiple applications (incident, problem, change etc).
- Leaving a UI action active means the condition will get evaluated, but leaving it inactive may leave it vulnerable to being removed by a future developer
- I like the idea that defining a UI action with the same 'action name' in an extended table will override a UI action defined against a parent table as it feels closer to an object-oriented approach - but then what's the point of the 'overrides' field? and are there any downsides?
It's a nice problem to have though. I'd hate to be sitting here saying "why can't I achieve this!"
Thanks guys
Dan
Solved! Go to Solution.
- Labels:
-
Best Practices
-
User Interface (UI)
- 7,774 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 06:26 AM
Hi Daniel,
As you rightly said that there are multiple ways to do this and all of them will provide the 'RIGHT' result.
Burt generally speaking in such scenarios i go with the override the ui action option. Its neat, limited to a table or scope and you will save yourself from touching a global object that might have cross stream impact.
i got confused with so many options so ill just write it down:
So create a UI Action on change_request with same name, same action name and same order and condition = false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 07:20 AM
So there is no other way to override OOTB UI actions which doesn't have action name without touching OOTB UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2018 06:50 AM
None of the above method helped me to hide the ui action.Its only overiding but noe hiding.If I make active = false,the overided action starts working.