You need to sign in to do that
Don't have an account?
salmanmanekia
Application deployed with Ant (Migration tool) but would not work
Hi,
I am developing an application in which i am retrieving records from an object and then want to insert (some of the fields of the) records into different objects. Below is my code in which i cannot figure it out that why my objects are not being populated and new record cannot be seen .
public with sharing class ScheduleBatchLauncher{ public static String scheduleBatch(Datetime batchTime){ CreateAndModifyScheduler batchSched = new CreateAndModifyScheduler(); String cron = '20 25 * * * ?'; String schedId = System.schedule('Create and Modify Batch 1', cron, batchSched); return schedId; } }
global class CreateAndModifyScheduler implements Schedulable{ global void execute(SchedulableContext sc) { CreateAndModify scBatch = new CreateAndModify(); database.executebatch(scBatch); } }
global class CreateAndModify implements Database.Batchable<sObject>, Database.Stateful{ global CreateAndModifyProcessor processor; global CreateAndModify(){ this.processor = new CreateAndModifyProcessor(); } global Database.queryLocator start (Database.BatchableContext BC){ return Database.getQueryLocator([Select Agreement_ID__c, Begining__c, Contact_Email__c, Contact_Name__c, Country_Code__c, Currency__c, Customer_Address__c, Customer_ID__c, Customer_Name__c,Customer_Postal_Code__c, Ending__c,Price__c FROM Unprocessed_Agreement__c]); } global void execute( Database.BatchableContext BC, List<sObject> listObj){ list <Account__c> inAcc = new list<Account__c>(); for (sObject lo : listObj){ Unprocessed_Agreement__c temp = (Unprocessed_Agreement__c)lo; inAcc.add(processor.processAccountRecord(temp)); } insert(inAcc);
update(inAcc)
} global void finish( Database.BatchableContext BC){ } }
global class CreateAndModifyProcessor { global Account__c processAccountRecord( Unprocessed_Agreement__c temp){ Account__c tempAcc = new Account__c(); tempAcc.Customer_Name__c = temp.Customer_Name__c; tempAcc.Customer_Address__c = temp.Customer_Address__c; tempAcc.Postal_Code__c = temp.Customer_Postal_Code__c; return tempAcc; } }
Please if someone can have a look at it. Also, if someone wants to see my build.xml or package.xml please tell..Thank You
i just figured it out that my apex jobs and scheduler job are empty. can someone please have a look and share what could be the reason