Creating multiple records Instead of creating one.

Lucky1
Tera Guru

Hello all,

 

After we do service-mapping in CMDB, We will save the view and it will be saved in the Map Views (ngbsm_view)

So, once I save the view, usually I will also save the same for the owned by of the business application.

So, now I have written a BR to avoid doing this manually. But the BR is creating multiple records, that is more than 150. I have seen 186 has come up, when I open a Saved View, changed the version and right click on the form header then Insert and Stay.

So, can some one help me?

 

My BR:

Lucky1_0-1755253667475.png

 

Script:

Lucky1_1-1755253698686.png

 

 

 

 

 

Regards,

Lucky

6 REPLIES 6

Raghu Ram Y
Kilo Sage

@Lucky1 

You shouldn’t use insert() or update() on current in an after Business Rule when working on the same table. This will try to save the same record again, which can cause duplicates or infinite loops.

If you just need to set values on the same record, use a before Business Rule. ServiceNow will save the changes automatically.

Hi Raghu,

 

Then how can I achieve my logic?

 

 

Regards,

Lucky

Bhuvan
Kilo Patron

@Lucky1 

 

You are creating a record in ngbsm_view table 'after' record 'insert' in the same table using BR.

 

Check your logic and change the table and when to run conditions, it should work fine.

 

Thanks,

Bhuvan

Hi Bhuvan,

 

How can I change the table, because I want to create one more record to the Business owner?

So, can you guide me how to achieve my task then?

 

 

Regards,

Lucky