Add error message when adding Parent & child incident

Kusuma Sai
Mega Guru

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 

Screenshot 2025-04-16 171652.jpg

1 ACCEPTED SOLUTION

@Kusuma Sai 

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.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

24 REPLIES 24

@Ankur Bawiskar No sir, I am facing issue with After BR - update operation.
when added the Parent incident then saved the record - after saved reloading the form - then BR error message is showing.

@Kusuma Sai 

your business rule should be configured to run as Before Update

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar , Can you please help me on Before Update, i have tried it- but not helping

@Kusuma Sai 

please share what before update BR you configured, share screenshots

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

KusumaSai_0-1744892713881.jpeg

 

tried like
if(!previous.child_incidents && current.child_incidents){

gs.addErrorMessage('child Error');

current.setAbortAction(true);

}

Tried with 'parent_incident' and 'child_incidents' also @Ankur Bawiskar sir

i think the issue with both 'parent_incident' reference field and using same field value in BR also when adding 'child incident' by using related list. 

But using 'child_incidents' it was not working
please suggest how to over come this issue