//starthttps://uat--maguat.cs101.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage# global Database.QueryLocator start(Database.BatchableContext BC) { string sQuery = ''; //squery='SELECT Id ,Status__c, (SELECT Id, Status__c FROM Subscriptions__r), (SELECT id FROM cases) from contact'; sQuery = sQuery + 'select id,Contact__c,LastModifiedDate from Subscription__c'; sQuery = sQuery + ' where VerifiedDate__c!=null'; // and LastModifiedDate >=:lastModifiedFromDate';// and Status__c!='+'\''+'Deleted'+'\''; sQuery = sQuery + ' and Status__c in :activeSubscriptionStatusList'; //only active subscriptions //sQuery = sQuery + ' And CreatedBy.name=\'Aslam Iqbal\''; System.debug('sQuery:' + sQuery); //System.debug('lastModifiedFromDate:'+lastModifiedFromDate); return(Database.getQueryLocator(sQuery)); }
//execute global void execute(Database.BatchableContext BC, List <sObject> scope) { Set <ID> setContactIDs = new Set <ID>(); try { //1. get all ContactIDs for scoped subscriptions for (Subscription__c sub:(List <Subscription__c>)scope) { System.debug('sub:' + sub); setContactIDs.add(sub.Contact__c); } //2. get all subscriptions for the set of contacts - into map-of-contact_And_ListOfSubscriptions map <ID, List <Subscription__c> > mapContactAndSubscriptionsList = new map <ID, List <Subscription__c> >(); for (Subscription__c sub:([SELECT id, contact__c, VerifiedDate__c, contact__r.VerifiedDate__c from Subscription__c
public Database.QueryLocator start(Database.BatchableContext BC) { throw new global::System.NotImplementedException("PluginBatchable.Start"); }
public void finish(Database.BatchableContext BC) { throw new global::System.NotImplementedException("CommittingBatchable.Finish"); }
public void execute(Database.BatchableContext BC, List <SObject> scope) { throw new global::System.NotImplementedException("CommittingBatchable.Execute"); }
public Database.QueryLocator QueryLocator(Database.BatchableContext bc) { return(Database.GetQueryLocator(Soql.query <Contact>(@"SELECT Id FROM Contact"))); }
public void execute(Database.BatchableContext param1, List <object> param2) { throw new global::System.NotImplementedException("Batchable.Execute"); }
public System.Iterable start(Database.BatchableContext param1) { throw new global::System.NotImplementedException("Batchable.Start"); }
public void finish(Database.BatchableContext param1) { throw new global::System.NotImplementedException("Batchable.Finish"); }