- 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
ā06-21-2021 04:52 AM
Just put the Action name in hide function
hide('btn_assess');