How to prevent a user from changing the problem state before filling out the mandatory fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 04:47 PM
Hi,
Can some one help me to setup a rule that prevents users from changing the state prior to filling out the fields that was set to be visible and be mandatory on another state. In this case I have too fields that I have created a UI policy for them to show up when our problems are at RCA review state, and they are both mandatory, but the problem is that a user can bypass this state and go the the next state; now is there any way to prevent this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 04:51 PM
Try using data policies which can handle service side too

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 05:04 PM
Hi Eliana,
You need to write a business rule and check if these fields are filled out. Other wise use current.setAbortAction() to abort the save.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 05:35 PM
Hi Eliana,
Please check if this helps. You can have an array of required field and then check if any of the field does not contains any value then set the flag and based upon the flag terminate the form submission.
function onSubmit() {
var reqFields = ['description', 'justification', 'details'];
var check_point = false;
for (var i = 0; i < reqFields.length; i ++) {
var val = g_form.getValue(reqFields[i]);
if(val == '')
check_point = true;
}
if(check_point == true){
alert('Mandatory Fields are required');
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 05:40 PM
Hi Eliana,
Do you want these fields to be Visible when the state is 'RCA Review' and states after that or only when it is 'RCA Review'. I would recommend to the fist option and create a Client Script to check for these fields to be filled for all 'RCA Review' and states after. This will give you a better usability.
Hope this helps. Mark the answer as correct/helpful based on impact.
Thanks
Antin