Business Rule not triggering on Insert, but working on Update

David Boom
Tera Contributor

Trying to update field on task on insertion but it is working only on update.

Image (1).jpg

18 REPLIES 18

Ankur Bawiskar
Tera Patron
Tera Patron

@David Boom 

as per your Business rule configuration it will set that field during insert and every update

what's your requirement?

The logic will work provided the field you are dot walking fields has data in it

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

Logic is not working for insert.

@David Boom 

it will only work during insert provided these fields are present an data populated in it

indicator field on form is populated?
If yes then entity field within indicator is populated?

If yes then does that entity record has name in it?

If answer to all above is Yes then it will work fine

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

Rajesh Chopade1
Mega Sage

hi @David Boom 
Remove current.update() in the Before Insert script.

you can add a check to make sure the reference field is set before trying to access entity.name,  Here's an updated version of your script with a check:

 

if (current.indicator && current.indicator.entity) {
    var gn = current.indicator.entity.name;
    current.u_entity_name = gn;
} else {
    gs.error("Indicator or Entity not set on the current record.");
}

 

 

If the above script still doesn't work, consider enabling debugging on your business rule and checking for any additional errors or messages in the logs to help pinpoint the issue.

 

I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

Rajesh