After BR causing duplicate entry in audit history

revathy muruga1
Tera Contributor

Hi Team,

 

I have "Primary interface" field with same backend name on two table(custom extended attributes and business application).

1. after br - update :

if primary interface changes in custom extended attributes table , this script updates the primary interface field on business application table.

revathymuruga1_1-1671713254091.png

 

 

2. after br - update:

if primary interface changes in business application table, this script updates the primary interface field on custom extended attributes table.

revathymuruga1_0-1671713208826.png

 

history list on custom extended attributes table.:

revathymuruga1_2-1671713316673.png

 

3 REPLIES 3

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

It sounds like one BR is triggering the other - you can verify this if you do a BR debugging.

Try adding .setWorkflow(false) to the the BRs to prevent this, i.e.

bapp.setWorkflow(false);

in the first BR just before your bapp.update(); line, and

customE.setWorkflow(false);

in the second BR, just before your customE.update(); line.

Sagar Pagar
Tera Patron

Hi @revathy muruga1,

There may be another after update business rule is running after this business rule. Hence it adds two updates record in audit.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi @revathy muruga1 

 

Your code 

customE.update()

and bapp.update()

 

should be within "If" blocks.

 

 

 


Thanks and Regards,

Saurabh Gupta