Omit Condition not Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 01:36 AM
Hi,
I want the edit button to be visible on the related list based on certain condition. However, even the info message is not working in edit. If I paste the same script in Omit new condition it works but looks like the control does not even reach the edit part. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 02:21 AM
Hi Vidya,
checkout below article.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0687843.
Thanks,
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 02:22 AM
Hi Vidya,
checkout below article.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0687843
Thanks,
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 02:49 AM
You need to check the Omit Edit Button field. On your screenshot is is unchecked. Once checked your script will run and decide whether the Edit button should be shown. Typical script returns answer = true/false e.g.
var answer;
if(gs.getUserID().isMemberOf(current.assignment_group))
{
answer=false;
}
else{
answer=true;
}
If the Script evaluates to true the Edit button is NOT shown.
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 04:37 AM
Even though it does not work that way, I already tried checking the Omit edit button. It did not work.
Omit check box, if checked, will always omit the button, no matter what is written in the script. If the script has to get executed, we need to uncheck the box.