Script to make related list entry mandatory
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 10:49 AM
I have a requirement to make sure incident pending change related list tab on change request form is mandatory when emergency breakfix is ABC and classification is DEF or classification changes to DEF.
I have written below code on change table using before business rule (update ) with filter conditions as priority 1 ,breakfix as ABC and classification as DEF
(function executeRule(current, previous /*null when async*/) {
var inc = new GlideRecord("incident");
inc.addQuery("parent", current.getUniqueValue()); // set the condition
inc.query();
if(!inc.hasnext())
{
gs.addErrorMessage(" reject ");
current.setAbortAction(true);
}
})(current, previous);
It is throwing the error message but classification value is changing from DEF to xxx(previous value) after adding incident to the related tab.
Pls help in fixing the issue.
0 REPLIES 0