Cireson Portal - Form Customization - Set Field to Required based on Work Item Status
I can set a field as required by adding "required = true," to most fields. However, I want to set a field to required when the form status changes to Completed, or Failed.
My use case is an Incident or Release record that failed. While they are suppsoed to enter in a reason why to it failed, there are many that don't. So i want to force the field to be required when the status (the enumerated value) is in a closing state.
Answers
Usually at that point, most analysts (That I've worked with anyhow) would just cancel the save so they don't have to comment.
A better solution would be a nag that they can't ignore.
Maybe an e-mail reminder that bugs them every day they do not enter the required detail, or a custom form that pops up on the portal and forces them to make updates before they can do anything else.
I've done a solution similar to the e-mail one. People quickly learnt to make sure they entered the details in the WI. However, I feel the second option might be a little more polished and professional.
I don't think this would be when the analyst open. This is when the analyst changes the status. Which would be after the open and change the status. At that time, client side script to change the required property to true.
So this would prevent them from saving it with that new status unless something is filled in that field.
https://support.cireson.com/KnowledgeBase/View/1188#/
I quickly put this together but did not fully test it:
In this example, if the IR status is changed to resolved (2b8830b6-59f0-f574-9c2a-f4b4682f1681) I set the Title text field to required and change the label.
I hope this helps.
Thanks
I have been trying to get this to work but I lack some understanding.
I am trying to do this
If the status that the SR is being changed TO is Completed and the supportgroup is blank, null, whatever
then pop the alert and make the analyst fill it out.
I see lots of posts for folks trying to do this but no definitive solution.
We want to be able to transfer the ticket with the analyst, support, group, area, blank until it is being completed
Is this anywhere close because I can't get it to work.
Thank you
Jeff
app.custom.formTasks.add('ServiceRequest', null, function (formObj, viewModel) {
I think your check for supportgroup being empty maybe a little too simplistic, try this out:
@james_kleinschnitz
You are going to make a log of people very happy. I have it working but it will need a few tweaks to keep the Chrome users honest since they can Cancel the Leave the Page and still complete with blank fields. Another question. Can I get to the Assigned to user and the Area in the viewmodel because I don't see it. I will post the complete code when done. Thank you so much.
var isareaEmpty = _.isUndefined(viewmodel.Area) || _.isNull(viewModel.Area);
var isAssignedToEmpty = _.isUndefined(viewModel.assignedtouser)
and Area is: viewModel.Area