After business Rule - Insert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 03:40 AM
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?
- Labels:
-
business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 04:33 AM
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 04:37 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 04:37 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 04:55 AM
Thank you for your replies.
I am trying to insert description via business rules after new record insertion.
Check screenshots.