You need to sign in to do that
Don't have an account?
Test Test 143
store result of Database.QueryLocator in List in BatchApex
Hi All,
As Part of my BatchApex Development, I need to store result of Database.QueryLocator in List.
Database.QueryLocator abc = Database.getQueryLocator('Query');
store ids in list by iterating abc
And need to use that list in,
As Part of my BatchApex Development, I need to store result of Database.QueryLocator in List.
Database.QueryLocator abc = Database.getQueryLocator('Query');
store ids in list by iterating abc
And need to use that list in,
- Return Database.getQueryLocator ('Query in : abc(ids)');
you can try like below in the start method.
If this helps, Please mark it as best answer.
Thanks!!
Thanks for your time and help!
I am sorry for confusion.
In start method of batchapex,
global list<task> tasks=new list<task>();
global Database.QueryLocator start(Database.BatchableContext BC){
list<id> tasks=new list<id>();
Database.QueryLocator tasking=Database.getQueryLocator('select WHOID from task where conditions');
for(task s: (list<task>)tasking){
tasks =s.id;
}
return Database.getQueryLocator('select id from Lead where AND ID NOT IN : tasks');
}
Help me in above bold part.
Thanks!