Conflicts in business rules and best practice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 12:14 PM
Dear all,
Currently I came across situation where 2 completely independent business rules were conflicting.
business rule 1.
This is OOB business rule on task table to set reassignment count.
Business Rule 2:
This BR I created to copy user's company from request to catalog task.
Since I created 2nd business rule mentioned above I was getting incorrect reassignment counts for catalog tasks, and was not getting any idea what went wrong as these 2 business rules are completely unrelated,
As a part of fixing this issue I ran 2nd business rule before insert as a trial test and it worked.
This got me wondering , what cautions should be followed while working on Business rules , in this current case do I need to check any other business rules what might get affected by this, how can I identify if there might be any impact of business rule I'm creating.
Regards,
Surendra Deshmukh
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 12:54 PM
There are incredibly rare cases where you should update the current record in After business rules. If you do, you probably want to use current.setWorkflow(false) which will prevent other business rules from running again. What you are seeing in your original setup is all business rules were running twice.
Also, read, understand, and use the best practices here: Business Rules Technical Best Practices Overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 12:57 PM
Thanks Tim,
I'll check on these links you have provided.