- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 05:54 AM
Hi,
I have Business Rule and the error messgae is getting displayed eventhough i have filled the worknotes and update
When - Before
Condition - State changes to Assess
(function executeRule(current, previous /*null when async*/ ) {
var leadTime = gs.getProperty('pan.bt.change.lead.time');
if(leadtime == 'true')
{
if (current.work_notes == '') {
gs.addErrorMessage('Change has been marked "Expedite", please provide the justification in Notes section.');
/current.setAbortAction(true);
current.state = previous.state;
gs.setRedirect(current);
} else
current.u_expedite_change = true;
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 06:07 AM
try below,
if (current.work_notes.getJournalEntry(1)=="") { //change this line
gs.addErrorMessage('Change has been marked "Expedite", please provide the justification in Notes section.');
/current.setAbortAction(true);
current.state = previous.state;
gs.setRedirect(current);
} else
current.u_expedite_change = true;
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 06:07 AM
try below,
if (current.work_notes.getJournalEntry(1)=="") { //change this line
gs.addErrorMessage('Change has been marked "Expedite", please provide the justification in Notes section.');
/current.setAbortAction(true);
current.state = previous.state;
gs.setRedirect(current);
} else
current.u_expedite_change = true;
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 06:48 AM
how this will work? by adding this line . Can you explain me?
if (current.work_notes.getJournalEntry(1)=="")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 06:54 AM
Hi ,
When i do testing on it.
I am getting this error message everytime
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 06:08 AM
if(leadtime == 'true')// here leadTime need