Conflicts in business rules and best practice.

sr_surendra
Giga Expert

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.

find_real_file.png

find_real_file.png

 

Business Rule 2:

 

This BR I created to copy user's company from request to catalog task.

find_real_file.png

find_real_file.png

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

2 REPLIES 2

Tim Deniston
Mega Sage
Mega Sage

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

sr_surendra
Giga Expert

Thanks Tim,

 

I'll check on these links you have provided.