I wanted to hide the new button for change tasks under change request related lists for some states

prasannasun
Tera Contributor

I wanted to hide the new button for change tasks under change request related list and made modifications in list control and added the script in omit new condition but not sure why this is not working, Can you let me know if we have to do any configurations other than script in omit new condition. here is the script I am trying and made multiple ways in script but still not working.

 

var answer;
if (!parent.active || ![3, -2, -1, 4, 0].includes(parent.state)) {
    answer = true; // Hide the "New" button
} else {
    answer = false; // Show the "New" button
}
answer; is there any way that I wanted to hide the new button for these states, I wanted to show only for new, asses and authorize state.
2 REPLIES 2

Ct111
Giga Sage

You can code something simple like below 

 

LINK

 

I hope this helps

prasannasun
Tera Contributor

Hi everyone, thanks for taking your time I got the code corrected which I did slight mistake while giving or condition. I resolved it and it's working now.