Omit Condition not Working

vidhya_mouli
Giga Sage

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?

 

vidhya_mouli_1-1724315799949.png

 

 

6 REPLIES 6

aish1234
Tera Contributor

Hi Vidya,

 

checkout below article.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0687843.

 

Thanks,

Aishwarya

aish1234
Tera Contributor

Hi Vidya,

 

checkout below article.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0687843

 

Thanks,

Aishwarya

Paul Curwen
Giga Sage

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.

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

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.