- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2025 04:50 AM - edited ‎04-17-2025 03:15 AM
Hi sir,
1. If i have a added a Parent incident by using reference field - then show the error message on the form
2, If i am adding a child incident by using related list - then show the error message on the form
for 1st scenario - i have written OnChange cs- it works perfectly.
for 2nd scenario - i have written after BR - update - works fine. but when added a parent incident then update/save the incident then it was showing the AfterBR error message. it won't comes when adding a incident in the reference field. please suggest
@Ankur Bawiskar , @Kieran Anson. @AndersBGS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2025 02:01 AM
it's a expected behavior
the business rule will run when you change the reference field and it's a change to parent field and the BR condition will satisfy and it will throw error
Also when the record is linked with parent via New/Edit the same BR will run as parent field is getting updated.
I believe this much info should help you.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 03:21 AM
so you are getting error message and if you want to stop then use this line after that error message
current.setAbortAction(true);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 03:25 AM - edited ‎04-17-2025 04:06 AM
Hi @Ankur Bawiskar Sir,
I have tried that one, but any user opened any incident(ex:INC101) and added incident 'parent Incident' field by using 'reference field' and saved the form, then The Business Rule error message is showing on the form.
please suggest how to abort this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 04:41 AM
so you don't want BR to run when parent field changes
you want BR to only run when Edit is clicked and show the error message then?
I doubt you can separate out the place from where the BR is triggering
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 04:56 AM - edited ‎04-17-2025 04:58 AM
@Ankur Bawiskar No sir, after adding the child incident the form was reloaded - in that reloaded form - show the error message.
Error message is displayed as expected, but when i am updated an another incident 'parent_incident' field - same error message showing- i don't want that.
only after adding the child incident -then only show the error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 05:00 AM
your onchange client script will give error when the value is changed.
try to use this as 1st line in client script just before checking the newValue
g_form.clearMessages();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader