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 , I have tried with 

UI policy - condition 'child_incidents' is not empty

On load cs also, but when I am opened that particular incident still the error message is showing.,

So I am not considered that solutions. And went with BR only.

Robert H
Mega Sage

Hello @Kusuma Sai ,

 

Can you please start by explaining what your business requirement is?

 

All I see in this thread is that you have written logic that shows error messages when people add parent or child incidents. But that's probably not your actual requirement because adding parent or child incidents is a normal activity in Incident Management and not an "error".

 

So what is the actual purpose of this? Do you want to prevent that users can add parent or child Incidents?

 

Regards,

Robert

Hi @Robert H ,
my requirement is need to show Info message, when any end user added the child incidents. like 'Now the incident is controlled by parent.' 
facing issue - when added parent incident then save/update the incident- this child info message is showing.
please suggest only info shows when adding child incidents.

Hello @Kusuma Sai ,

 

Thanks for clarifying that this about an info message, and not an error message. That makes more sense.

 

Technically, there is no difference between going to Incident 1 and adding Incident 2 as a Child incident, and going to Incident 2 and setting 1 as its Parent Incident.

Both results in the "Parent incident" field of Incident 2 to be set to Incident 1. That's the condition that your Business Rule is checking, so in both cases it will show this info message.

 

So please just disable the Client Script and keep only the Business Rule, since it will take care of showing the message in both scenarios. You should also make the message more clear by saying something like "Incident {current} is now controlled by parent Incident {parent}".

 

Regards,

Robert

Hi @Robert H / @Ankur Bawiskar ,
Yes sir,  I think this is expected behavior. I have written After/Before Business rule

Condition is if any child incident is added by using UI Action EDIT button - then show the Info message.

Issue : if i am added a new parent incident - in the incident form by using reference field - in the backed this current incident is adding as child incident - then Executing the BR - then showing the Info message.

Disabled the client scripts.

please suggest - should we prevent this, if not can please suggest why