List<Account> Scope = [SELECT id FROM ACCOUNT];
// This is the query being used
global void execute(Database.BatchableContext BC, List<Account> scope)
{
List<Account> accounts = [SELECT id, (SELECT outreach_status__c,Initial_Contact__c, Champion__c, Finance_DM__c, Operations_DM__c, Executive_Sponsor__c ,LastActivityDate FROM Contacts) FROM Account WHERE Id in :scope];
}
Or is it
List<Account> Scope = [SELECT id FROM ACCOUNT];
// This is the query being used
global void execute(Database.BatchableContext BC, List<Account> scope)
{
List<Account> accounts = [SELECT id, (SELECT outreach_status__c,Initial_Contact__c, Champion__c, Finance_DM__c, Operations_DM__c, Executive_Sponsor__c ,LastActivityDate FROM Contacts) FROM Account WHERE Id = :scope];
}
Basically I am not sure if I should use "ID IN :Scope" or "ID = :Scope". I am asking this because I am finding that not all records are being processed.
IN
and=
is the same for a collection.IN
or=
equally here, they're both valid.