‘New’ button hide for change task

Lili12
Tera Contributor

Hallo, 

I want to be able to create a change task with the ‘New’ button, but only if the (parent) change has the status ‘New’, ‘Assess’, ‘Authorise’, ‘Scheduled’ and ‘Implement’.
Displaying it worked via List Control.
Do you have any idea how I can hide the ‘New’ button on the change task? So if the (Parent)Change has the status ‘Review’, ‘Closed’ or ‘Canceled’ the ‘New’ button has to be hidden in the change task

Lili12_0-1747144942659.png

Thanks

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Lili12 

Steps

1) right click on related list Configure -> List Control

2) Use Omit new condition script field (if this field is not on form then add it on form)

3) script to be added in that script field

if (parent.state.toString() == '0' || parent.state.toString() == '3' || parent.state.toString() == '4')
    answer = true; // omit when closed, cancelled or review
else
    answer = !parent.active; // show only if CHG is active

AnkurBawiskar_0-1747145393497.png

 

AnkurBawiskar_1-1747145533624.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