Validate Mandatory Fields on GlideRecord update?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 07:32 PM
I am working on a requirement where when a release task is closed, it should automatically update the parent release to the next state. I have a business rule that runs on the release task after update. The tricky part is, it should not update if the mandatory fields on the parent release are not all populated. I am making the fields in question mandatory with UI policies on release table.
One idea I had, was to use data policies instead of UI policies to enforce mandatory, as they run on the server side. But one issue I encountered is the annoying 'Data Policy Exception' messages that show up on the page, often multiple times and I can't seem to figure out how to get rid of them. I tried a try-catch around the GlideRecord update but that didn't work. Also as a more critical issue, the state flow automatic script I have for the next state seems to run regardless of the update to the next state failing.
The only other idea I have is to check all the mandatory fields field by field in the business rule. This would not be a clean solution as I have multiple UI policies with different conditions whose logic I would have to copy into the business rule, and also if the UI policies were ever changed in the future the business rule would have to be updated with it which seems difficult to maintain.
So is there a cleaner solution to this problem?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 07:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 07:48 PM
That would not solve my problem. The mandatory fields I'm referring to are on the parent release form. I need to validate those fields are populated, not that the parent release on the release task is populated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 08:00 PM
If I understand correctly then you want to check if the parent release record's field has value or not. you can access the parent task field like.
then again in the field search type parent,
and then again search the parent table field (which you have made mandatory on the form) to check if that's not empty then trigger the BR.
Please correct me if my understanding is wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 08:04 PM
Sorry, your understanding is wrong. I want to check if all of the mandatory fields on the parent release form are populated, such as rm_release.short_description, rm_release.assignment_group, etc. I have UI policies running on the parent release form, so depending on a variety of conditions there could be different fields that are mandatory/not mandatory in each case.