0
Q:

batch apex list of custom object in apex salesforce

global class batchTestNew implements Database.Batchable<sObject>{

public List <Contact> accountsToParseSet = new List<Custom_Object__c>();

   global batchTestNew(List<Custom_Object__c> accountsToParseGet){
   accountsToParseSet = accountsToParseGet;          
   }

   global Database.QueryLocator start(Database.BatchableContext BC){
      return accountsToParseSet;
   }

   global void execute(Database.BatchableContext BC, 
                       List<sObject> scope){
      for(sObject s : scope){
           upsert accountsToParseSet;
                  }      
      update scope;
   }

   global void finish(Database.BatchableContext BC){

   }

}
0

New to Communities?

Join the community