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 02:45 AM
Hi,
Did you try with gs.sleep function
gs.sleep(5000);
Regards,
Suresh.
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 03:11 AM
This function is not supported in scope application, and the time is not fixed therefore we can't use sleep method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2022 03:01 AM
Hi,
why not use function calls and separate out the code
1st function which is called will update
then the 1st function will invoke 2nd function to do next activities
updateRecords();
function updateRecords(){
// your code to use updateMultiple
nextActivities();
}
function nextActivities(){
// add next logic here
}
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 03:18 AM
Did you check my above approach?
It should match your requirement
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader