Hide the related list UI action New and Edit in Change form

ServiceNow10sun
Giga Guru

Hi All , 

 

I have a requirement that in Change form in the related list Ui actions button 'new' and 'Edit'  should not be visible in Authorize, Scheduled ,implement ,review  and closed stage. 

Please suggest how to achieve this. 

In all below related list the New and Edit shouldnt be visible in these states.

sunita10_0-1676862728346.png

Thank you In advance. @Ankur Bawiskar @Community Alums 

2 ACCEPTED SOLUTIONS

@ServiceNow10sun 

update as this

var answer;
if (parent.state.toString() == '-5'|| parent.state.toString() == '-4')
{
	answer = false;
}
else {
	answer = true;
}

answer;
Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Ratnakar7
Mega Sage
Mega Sage

Hi @ServiceNow10sun ,

 

Please try with below script, no need to declare answer as variable.

 

 

 

 

 

answer = (parent.state==-5 || parent.state==-4)?false:true;

 

 

 

 

Ratnakar7_1-1676969534251.png

 

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
If it helps please click Accept as Solution/hit the Thumb Icon.

 

Thanks,

Ratnakar

View solution in original post

13 REPLIES 13

For e.g. this is used on Incident table. Try to copy this:

 

if (parent.incident_state == 7)
true;
else
false;

Regards,Shamma Negi

Anubhav24
Mega Sage
Mega Sage

Hi Sunita,

Are you writing omit new/edit conditions as well as omit new/edit checkbox is true. If yes then try just with one. Either checkbox is true or only write conditions for omission.

 

Omit new button and omit  edit button is uncheck :

 

sunita10_0-1676971358129.png

 

Ratnakar7
Mega Sage
Mega Sage

Hi @ServiceNow10sun ,

 

Please try with below script, no need to declare answer as variable.

 

 

 

 

 

answer = (parent.state==-5 || parent.state==-4)?false:true;

 

 

 

 

Ratnakar7_1-1676969534251.png

 

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
If it helps please click Accept as Solution/hit the Thumb Icon.

 

Thanks,

Ratnakar