Query regarding Before BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 09:13 AM
Hi All,
My question is about Before BR. Suppose I am inserting 100000 records through scheduled fix script daily. Will before BR work in this case?
Thanks,
Tara Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 09:23 AM
Im not sure what you mean by Before BR will work in this case?
But if you insert record the before BR will be executed for each insert unless specifically you have added somewhere in the script not to.
By using setWorkflow(false) you can ensure the BRs not run for that transaction , but that will exclude all BRs not specific ones.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 07:54 PM
Hi @Tarasingh26 , how are you?
Business Rules are executed before the record is saved, this means that the Business Rules will run normally and only then will your record be saved
Your script creates the record >> BR are executed >> Your record is saved
And that's why you shouldn't have current.update in business rules beforehand, as they can cause business rules to be re-executed.
If my answer helped you, please mark my answer as helpful.
Vanderlei Catione Junior | LinkedIn
Senior ServicePortal Developer / TechLead at The Cloud People