Omit new button for Related list

Jeremyramirez12
Tera Contributor

I want to omit the 'New' button under the change tasks tab of a change request if the state of the change request is "Review." I am using the code below but it seems to be not working:

Jeremyramirez12_0-1714467529429.png

 

Any ideas or suggestions?

 

 

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron
Kilo Patron

HI @Jeremyramirez12 ,

 

TRY 

 

 

var answer;
if(parent.state == '0') { //pass the state value instead of label text , Pass the value as per your system . in my sys its 0
answer = true;
}else {
answer = false;
}

 

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

View solution in original post

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Hi Jeremy,

 

Are you sure with State label and value. Ensure you pass state value instead of label.

Also, it should be parent.state and not parent.State

Dr Atul G- LNG
Tera Patron
Tera Patron

Did you try with List control

 

AGLearnNGrow_0-1714467838856.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sohail Khilji
Kilo Patron
Kilo Patron

HI @Jeremyramirez12 ,

 

TRY 

 

 

var answer;
if(parent.state == '0') { //pass the state value instead of label text , Pass the value as per your system . in my sys its 0
answer = true;
}else {
answer = false;
}

 

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Worked! Thank you!