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

@Rylie Markle you want both the buttons ?

if not you can deactivate this button 

or you might have to write a condition where it does not satisfy the other UI action condition which you have created

please mark my answer correct if it helps you

jcmings
Mega Sage

Trying to understand why you want the field to become mandatory when the Close Complete button is clicked. Why not just have the fields be mandatory? This will prevent the case from closing unless a selection is made. Does the status of the case change when Close Complete is selected? If so, you can create a UI Policy that triggers on the request status changing.

 

Edit to add -- also, on line 3, you spelled "mandatory" incorrectly. 

If I just make the field mandatory, the fulfiller can't even click Start Work without making a selection (or add a comment or work note). The field just needs to be completed by the time the case moves to Closed Complete. 

What about a UI policy that sets mandatory in the state before Closed Complete?

I decided to do this and it worked, but now I'm stuck because I still want the fulfiller to be able to suspend the case without filling in the fields, just not click close complete. So I feel like I might need to go back to my original idea of the UI Action. Thoughts?