You need to sign in to do that
Don't have an account?
JeffreyStevens
APEX Batch getQueryLocator with queryString using the IN clause
How is the IN clause used with a set<> in batch and getQueryLocator?
I have this code:
Is this the correct syntax? How do you actually use a set<> (or .keyset() from a map) in a queryString that get's passed to the getQueryLocator?
I have this code:
// (in the Start method of a batch class....) set<id> accountIDs = new set<id>(); // This is already populated... queryString = 'SELECT id,name FROM Account WHERE id IN :accountIDs'; return Database.getQueryLocator(queryString);
Is this the correct syntax? How do you actually use a set<> (or .keyset() from a map) in a queryString that get's passed to the getQueryLocator?
Its correct.
Refer the below link.
https://salesforce.stackexchange.com/questions/339024/reference-setid-in-the-where-clause-of-a-dynamic-soql-in-batch-class
if this information helps, Please mark it as best answer.
Thanks!!