why using current.update() is not recommended in befor BR ?

Amarendra
Mega Contributor

the BR will update any record based on specified conditions only. Then why using current.update() is not a good practice ?

10 REPLIES 10

Thanks a lot !


You are welcome. If your question was answered, don't forget to mark the appropriate response as correct so others with the same question can find it easily.



Thank you


akashsrm100
Kilo Guru

This thread may help you


Never use current.update in a Business Rule


Thanks


Akash Sharma


NEVER is a strong word. For those who don't understand it, OK. However there are RARE cases when it is required. I won't get in to that. Find me at Knowledge some time and we'll have a good talk about it.


Midhun1
Giga Guru

Hi,



Avoid using current.update() to prevent recursions that impact system performance. The current.update() triggers business rules to run on the same table for insert and update operations. In a before or afterbusiness rule, this can lead to the rule calling itself over and over again.


It is unnecessary to use current.update() in a before business rule since these are saved automatically when the database is updated. After business rules are not intended to update current objects, so this is also not needed.