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
Ankit Agarwal 74Ankit Agarwal 74 

Mass update is not working in Batch process

Hi All,

I am trying to Update a field of Account in batch process, for single Account it is working fine but for multiple accounts it is not working.  i am doing this in execute method. here is my code, please correct me where i am wrong:

List<Account> accountAll = new List<Account>();
if(ListOfAllAccountsID.size()> 0){
                    
                    for (Account account :[SELECT id,Service_Flag__c FROM Account where Id = :ListOfAllAccountsID]) {
                            account.Service_Flag__c=true;
                            accountAll.add(account);
                    }
                    update accountAll;  
                }

before of this update operation, I am performing mass mail operation and thats working fine but when I go for update Account checkbox, mass update is not working
 
Raj VakatiRaj Vakati
Can you give me complete code ..the above lines are looks good to me  
 
Ankit Agarwal 74Ankit Agarwal 74
It's too large to share here. Can you give me your mail id so I can drop you code there. 

Thanks