After business Rule - Insert

ravimareedu
Tera Contributor

I am trying to assign value to assignment group with after business rule - insert. 

But not successful. 

I see only display messages are successful on after business rule - insert.

I think on same table update may not possible after insertion with business rules.

Am I doing wrong practice?

 

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ravimareedu 

 

Possible to share code here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Rene El Hamzh
Kilo Sage

Hi @ravimareedu

 

if you would like to make changes to the current record it's almost always best to use a before business rule. Here's a good explanation: ServiceNow Development Handbook - Business Rules  

 

Best regards,

Rene

 

Please mark as correct/helpful if my answer helped you!

Weird
Mega Sage

Are you updating a current record? Don't use a after rule for that.

After business rules run AFTER the record has been inserted or updated.
This means you'd have to include something like current.update() to update the current record with an after rule. This however triggers update BR's on the current record, so it's not recommended at all as it can cause a lot of issues.
If you're updating another record with GlideRecord, then using update() for that record is OK.

Use a before rule to change values on a current record. A before rule makes changes before the record is inserted/updated, so it doesn't need the current.update() call and it doesn't trigger BR's again.

ravimareedu
Tera Contributor

Thank you for your replies.
I am trying to insert description via business rules after new record insertion.

Check screenshots.

 

2-After-Business-Rule-on-Insert-Business-Rule-ServiceNow.png1-After-Business-Rule-on-Insert-Business-Rule-ServiceNow.png