Hide new button in change tasks related list

Paulo Campos Ch
Tera Contributor

How can I make the new button hide when the change is in implement state?

 

PauloCamposCh_1-1697734544442.png

 

3 ACCEPTED SOLUTIONS

Brad Bowman
Kilo Patron
Kilo Patron

Right-click in the column header area and choose Configure -> List Control.  Populate the Omit new condition field like this:

BradBowman_0-1697737898291.png

 

View solution in original post

Hemanth M1
Giga Sage
Giga Sage

Hi @Paulo Campos Ch ,

 

Please follow below steps

1)go to list control by right clicking on the column

HemanthM1_0-1697738489928.png

2)Look for Omit new condition script field (if its not there bring that field on to the form)

HemanthM1_1-1697738609297.png

3)Add the field 

HemanthM1_2-1697738672290.png

4)Add the below script

HemanthM1_3-1697738755223.png

 

var answer;
 if (parent.state != '-1' ) {
 //Do not remove the 'new' button
  answer = false; 
} 
else {
 //Remove the 'Edit' button
  answer = true;
}
answer;

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

Hi @Paulo Campos Ch ,

 

Close the loop by accepting the answer if it helped you so that othes can refer as solution.

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

Right-click in the column header area and choose Configure -> List Control.  Populate the Omit new condition field like this:

BradBowman_0-1697737898291.png

 

Hemanth M1
Giga Sage
Giga Sage

Hi @Paulo Campos Ch ,

 

Please follow below steps

1)go to list control by right clicking on the column

HemanthM1_0-1697738489928.png

2)Look for Omit new condition script field (if its not there bring that field on to the form)

HemanthM1_1-1697738609297.png

3)Add the field 

HemanthM1_2-1697738672290.png

4)Add the below script

HemanthM1_3-1697738755223.png

 

var answer;
 if (parent.state != '-1' ) {
 //Do not remove the 'new' button
  answer = false; 
} 
else {
 //Remove the 'Edit' button
  answer = true;
}
answer;

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hi @Paulo Campos Ch ,

 

Close the loop by accepting the answer if it helped you so that othes can refer as solution.

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025