Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to restrict state changes of task which is in related list tab from case form

mansa12
Tera Contributor

From case form i am able to change the task state to close even though the task closure code is mandatory, how can i abort it and show fill mandatory field and then close the task

1 REPLY 1

Ramz
Mega Sage

Hi @mansa12 ,

Write a onSubmit client script in the table

Code is:

if(state == 3)//change the state value to closed complete value in your table

{

g_form.setMandatory('closure_code',true);//backend name of your closure code field

alert('Fill mandatory field and then close the task');

return false;

}

 

Please mark my answer correct/helpful if it resolved your query.