Setworkflow(false) for specific business rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2025 10:55 PM
I have a business rule which updates the values in a particular table (let's say Table A) after a record is inserted in the same table. I have a before insert which calculates and sets the value. I have an after update which recalculates if values are changed. There is another after update which sets the values. I want my setworkflow(false) to disable only one of the business rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2025 09:42 AM
Hi,
I don't think it's possible to prevent specifics business rules to run.
In my option, the best scenario would be to use only before business rules to do the calculations, unless they are very time consuming. This would prevent any loop to occour.
You can also have all you business rule logic grouped in one single business rules that runs on the update, and in the code itself check which field has changed and apply the right sequence of calculation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2025 10:51 AM
Hi @nithin_s,
setWorkflow(false) disables all business rules and flows — you can’t target just one.
✅ Fix:
Add a guard condition in the specific BR you want to skip, like:
if (gs.getSession().getClientData('skip_my_br') == 'true') return;Then set that flag before your update.
Alternatively, use a custom flag field (u_skip_br) in the record to bypass that BR only.
