Challenge in UpdateMultiple() method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 02:37 AM
Hi All,
I am using UpdateMultiple() method in UI action for bulk updation(10 to 15 k records) and this method is taking near about 5 min to update all the records, but this updation process is running in background(Async) and this UpdateMultiple() method is immediately giving control to next line of the script so the next line is getting executed immediately after the UpdateMultiple() method.
But the next execution line should be wait till the UpdateMultiple() method completely update all the records (10 to 15K), so please guide how can I process further. (Just want to highlight that we are developing a scope application)
Thanks
Regards,
Mohsin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 03:19 AM
Hi Ankur,
Thanks for your input, but if go with the said approach we will face same issue/challenge as the nextActivties() Function will get called immediately next to updateMultile() Function.
As per our requirement the nextActivites() function should get call when all the bulk updation is done.
Note:- UpdateMultiple() method is running asynchronously but we want it should be act as a synchronous without affecting the performance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 03:32 AM
Hi,
then use updateRecord() within while loop and don't use updateMultiple() and then call the function
As per my understanding that's the only way
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 05:55 AM
Thanks Ankur,
Initially we tried with while loop along with updateRecord, but the loop will get executed multiple time depending upon the bulk count (10k) and we were facing performance issue. therefore we are using updateMultiple() method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 06:28 AM
Okay but I don't think any other option
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader