Stop Change Tasks from being Created When Approve

JonnyFoster
Tera Contributor

Hey pals. 

 

Hopefully a quick one - how would I go about removing the 'new' button on the change task related list when the change request goes past 'Assess' state? Essentially, in our current set up, someone is able to have a change technically approved (TAG) and then continue to add things to it.

 

I want to remove, or hide the 'new' button when the change's state is not 'new' or 'assess' on the 'change tasks' related list. 

 

Thanks!

1 ACCEPTED SOLUTION

nayanmule
Kilo Sage

@JonnyFoster  , This is a simple one.

Right click on the change task related list -> Configure -> List Controls

nayanmule_0-1766568419543.png

2. Edit the Omit New Condition 

nayanmule_1-1766568473495.png

 

3. Add the below script there 

if(parent.state.toString() == '-4' || parent.state.toString() == -5)
	answer = true; // hide
else
	answer = false; // show

You can give your backend values of the states "New" and "Assess" that you have configured.

 

If my response has helped you, mark it as helpful and accept the solution.

Regards,

Nayan

View solution in original post

4 REPLIES 4

Me Being Mustaq
Tera Guru

Hi @JonnyFoster ,

 

the “New” button on a related list is controlled by UI Policies / Client Scripts or by Related List conditions. Since you want it conditional on the parent Change Request’s state,

 

Here are the approaches:

  • Use a UI Policy on the Change Request form
  • Use a Client Script (form on Change)
  • ACL (Access Control List

I would suggest: UI Policy / Client Script UI control(hides the button) or ACL → best for true enforcement (prevents creation even via API or background scripts)

 

If it is helpful, please hit the thumbs button please mark the answer as correct based on the impact!!

 

Kind Regards,

Shaik Mohammed Mustaq

 

 

 

nayanmule
Kilo Sage

@JonnyFoster  , This is a simple one.

Right click on the change task related list -> Configure -> List Controls

nayanmule_0-1766568419543.png

2. Edit the Omit New Condition 

nayanmule_1-1766568473495.png

 

3. Add the below script there 

if(parent.state.toString() == '-4' || parent.state.toString() == -5)
	answer = true; // hide
else
	answer = false; // show

You can give your backend values of the states "New" and "Assess" that you have configured.

 

If my response has helped you, mark it as helpful and accept the solution.

Regards,

Nayan

Hello! Thanks for your help - I didn't realise the list control was available from there!

 

Your solution worked, although I had to swap the true/false reasoning as the opposite result was provided in testing, however the theory worked beautifully. 

 

if(parent.state.toString() == '-4' || parent.state.toString() == -5)
    answer = false; // hide
else
    answer = true; // show
 
Thank you!

nayanmule
Kilo Sage

@JonnyFoster  , Did my response help you ? If yes kindly mark as helpful or accept the solution to close the thread.

This will benefit the future readers.

Regards,

Nayan