function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AlwaysConfusedAlwaysConfused 

About using QueryLocators

Hi guys,

 

I'm fully aware of the point of query locators but i'd just like to know ...

 

If i query the API and get back the first batch, can i make a changeto the locator to go back to a point of my choosing from a previously failed query?

 

For example :

service.queryAsync(SOQL_Query);

 

Then i handle a few batches, then the query fails (for whatever reason - maybe loss of connectivity lets say) ...

 

So how do i get back to the point where the query failed (assume this query runs for over an hour)?

 

Best Answer chosen by Admin (Salesforce Developers) 
AlwaysConfusedAlwaysConfused

Never mind ...

 

Figured it out !

 

In case anyone needs to know :

 

From what i can see the querylocator object is a string in the format "queryid-nextrecord", i simply run a query and replace the bit after the "-" with the record i want to start processing from then call query more to begin processing.