Writing a script to make a field mandatory when Closing a Case

Rylie Markle
Tera Contributor

I am trying to write a script on a UI Action that sets a field as mandatory when you click Close Complete on a case. The field is a string with drop down options of yes and no. If a selection is not made and the fulfiller tries to close the case I want it to give them an error message.

Below is my UI Action and script so far. Am I on the right track?

 

find_real_file.png

 

 

find_real_file.png

12 REPLIES 12

Abhinay1
Giga Expert

Hello Rylie,

Create a UI policy and UI policy action on the state field to set the yes/no field as mandatory when state is set to Work in progress or which ever state the request usually sits in before Close Complete.

Hopefully this works for you.

 

Regards,

Abhinay

Hello, 

This did work for me, however, the only problem is that it won't let the fulfiller suspend the case because the fields are mandatory. Do you know of any ways I could get around this? I want them to be able to suspend, just not close. 

Hello Rylie,

The quickest suggestion on top of my head:

If you are suspending the case by selecting the state "Suspended" in drop down, than another UI policy and subsequent policy action on state field, if "State" is suspended, set yes/no field as not mandatory and reverse false.

If this does not work, please let me know how exactly a case is being suspended in your instance.

Hope his works.

Regards,

Abhinay