Script omit new condition in list

Vedavalli
Tera Expert

hi 

When I am trying to omit a New button of a Related List using script for a active field.If it is true it should new button if active is false it should not show new button

The thing is, it is hiding for both active false and true.

var answer;
if(parent.active=="true")
{
    answer=true;
}
else{
    answer=false;
}
this is the code i have used.

 

1 ACCEPTED SOLUTION

Maddysunil
Kilo Sage

@Vedavalli 

Please try below code:

 

var answer;
if (parent.active == "true" || parent.active == true)  {
    answer = true;  // Set to true to hide New button
} else {
    answer = false; // Set to false to show New button
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

View solution in original post

1 REPLY 1

Maddysunil
Kilo Sage

@Vedavalli 

Please try below code:

 

var answer;
if (parent.active == "true" || parent.active == true)  {
    answer = true;  // Set to true to hide New button
} else {
    answer = false; // Set to false to show New button
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks