Challenge in UpdateMultiple() method.

Mohsin2
Tera Contributor

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

8 REPLIES 8

ersureshbe
Giga Sage
Giga Sage

Hi,

Did you try with gs.sleep function

gs.sleep(5000);

Regards,

Suresh.

Regards,
Suresh.

This  function is not supported in scope application, and the time is not fixed therefore we can't use sleep method.

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Mohsin 

Did you check my above approach?

It should match your requirement

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader