Getting double comments when we use before update BR

subbarayudu
Tera Contributor

I have a choice  field called HITRUST , written a BR  when its changes to any value i need to populate  previous valued i the automated comments in that same table.

But here I am facing a challenge when i use before update  BR with out currnnt.update() getting two automated comments(duplicate).

i use after update  BR with  currnnt.update() getting only one  automated comments.

Any suggestions pls, to get only one automated comments.

 

subbarayudu_0-1723053265562.png

Thanks in advance

 

 

9 REPLIES 9

Allen Andreas
Administrator
Administrator

Hello,

You wouldn't use current.update() in your business rule at all.

You can access the previous value using previous and current value (what has been submitted and sent to the server to be saved) as current.

 

You would simply set the field to the value you need and that's it. In a before BR, it will automatically save it after it's done processing without needing current.update().

 

As far as two comments occurring, your current script doesn't show where you aren't using current.update() and you didn't show any proof that there's two showing on the record. Lastly, you could have multiple BRs setup that are triggering, so check that.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

@Allen Andreas when I  use before update BR without current.update, I am getting duplicate automated comments, is there any way to avoid them duplicate comments, I don't want to use current.update in BR.

@subbarayudu Could you please check if there are multiple before business rule triggering on the same table and if any of those BRs changing value of u_hitrust_type field.

Hi @subbarayudu 

As mentioned, the basic setup you have should only be resulting in one comment. Please read my reply above thoroughly and see if there are multiple BRs, etc. that could be causing this.

 

For some reason, people are replying echoing the same thing I've already said.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!