Creating multiple records Instead of creating one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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:
Script:
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Raghu,
Then how can I achieve my logic?
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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