Not able to make field mandatory on accepting risk in problem

Srashti04
Tera Contributor

Hi Community,

 

I want to make a few fields mandatory on the problem form when I click the Accept Risk button. I tried using UI policy, but when I click the Accept Risk button a dialog box asking for mandatory fields appears, and after filling when I click ok, it directly goes to the close state.

 

Use case: Here I want to make the u_impact field mandatory and for that, I have created a UI policy. But when I click on the Accept Risk button, the dialog box shown in the image below appears. After filling in mandatory details when I click on ok, it directly closes the Problem ticket without asking me to fill the u_impact field.

 

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

This is a timing issue with the modal that is opened when that button is clicked, and the UI Policy not triggering before the modal close action is taken.  Take a look at the UI Script named ProblemModalUIHelpers.  This runs client-side so it uses g_form. Add the conditional setMandatory in the onAcceptingRisk function, around line 215, then if the mandatoryCheck method does not detect and stop it, you may need a return false so that it closes the modal window.  If you are populating the Resolution code before clicking the Accept Risk button, you can try adding this to the UI Action named Accept Risk instead, before the modal window is opened.