global class BatchClassForPDFGeneration implements Database.Batchable<sObject>{
public static string strFileDescription='codes';
private Order__c OrderDetails;
private List<ResponseWrapperData.orderItems> OrderLineItems;
public BatchClassForPDFGeneration(List<ResponseWrapperData.orderItems> OrderLineItems,Order__c OrderDetails){
this.OrderLineItems=OrderLineItems;
this.OrderDetails=OrderDetails;
}
global Database.QueryLocator start(Database.BatchableContext BC){
String query = 'Select id from Order__c where id=\''+OrderDetails.id+'\' limit 1';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC,List<sobject> scope) {
}
global void finish(Database.BatchableContext BC) {
system.debug('Process End');
}}
Now calling this batch from apex class
// call this method when voucher type is PDF
public static void createGiftCardPDF(ResponseWrapperData.Response ResponseObject,Order__c OrderDetails){
// call batch class to generate pdf
GC_BatchClassForPDFGeneration giftCardBatch=new GC_BatchClassForPDFGeneration(ResponseObject,OrderDetails);
Database.executeBatch(giftCardBatch,200);
}
getting the following error
Constructor not defined: [BatchClassForPDFGeneration].(ResponseWrapperData.Response, Order__c)