Writing a script to make a field mandatory when Closing a Case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 09:48 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 11:20 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 10:00 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 10:06 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 10:11 AM
What about a UI policy that sets mandatory in the state before Closed Complete?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:22 PM
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?