How to Hide "New" Button on Change Task Related List When Change Request State is "Scheduled".

tilekarnilesh
Giga Guru

Hi everyone,


On the Change Request form, we needed to hide the "New" button on the Change Task related list whenever the state is changes to "Scheduled".

tilekarnilesh_0-1751635299170.png

 

3 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@tilekarnilesh 

you can configure list control and then use Omit new condition script field

AnkurBawiskar_0-1751635939633.png

 

// if CHG is active and state is not scheduled then show
if (parent.active && parent.state.toString() != '-2')
    answer = false; // show
else
    answer = true; // omit

AnkurBawiskar_1-1751636011301.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

@tilekarnilesh 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

@tilekarnilesh 

yes you will have to replace the existing one with the one I shared.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

@Ankur Bawiskar one last question 
Can I replace this script with a new one? in this box?? 

tilekarnilesh_0-1751637642201.png

 

@tilekarnilesh 

yes you will have to replace the existing one with the one I shared.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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