- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 11:40 AM
I have requirement to make hide UI action from form if logged In user and assigned to users are same. UI action is not sc_task table. Is it good practice if we make changes in OOTB UI action? What are all possible ways?
Thanks, Bilbo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 12:02 PM
Hello Bilbo,
1. To achieve your requirement, you need to add a simple condition: current.assigned_to!=gs.getUserID() condition Builder.
2. You need to override that UI action as its not best practice to modify any OOTB UI action.
3. Create New UI action and override with OOTB UI action that you want to hide
Alternative way for hiding UI action is with the help of DOM manipulation. Its not recommended by ServiceNow.
1. You need to write onLoad Client script and Make sure that you uncheck the field ISOLATED SCRIPT:
2. Add following code:
/Remove the 'Submit' button
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Submit') > -1){
item.hide();
}
});
3. Check out this useful blog:
https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 11:46 AM
You can create your own UI action, if the same UI action is used in other modules as well. Just make sure the action name are same.
Then add condition as current.assigned_to!=gs.getUserID()
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 11:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 12:02 PM
Hello Bilbo,
1. To achieve your requirement, you need to add a simple condition: current.assigned_to!=gs.getUserID() condition Builder.
2. You need to override that UI action as its not best practice to modify any OOTB UI action.
3. Create New UI action and override with OOTB UI action that you want to hide
Alternative way for hiding UI action is with the help of DOM manipulation. Its not recommended by ServiceNow.
1. You need to write onLoad Client script and Make sure that you uncheck the field ISOLATED SCRIPT:
2. Add following code:
/Remove the 'Submit' button
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Submit') > -1){
item.hide();
}
});
3. Check out this useful blog:
https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2019 12:04 PM