You need to sign in to do that
Don't have an account?
sandeep reddy 37
usingbatchapex update lookup field
how can we do batch apex updating lookupfield
program is exeuted but requir ment is not met
do this for me
global class batchapexforlookup implements database.Batchable<sobject> {
list<custmer__c> c;
global void batchapexforlookup(){
c=new list<custmer__c>();
}
global database.Querylocator start(database.batchablecontext bc){
return database.getQueryLocator('select area__c,digit__c,newcustmer__r.Name from application__c');
}
global void execute(database.batchablecontext bc,list<application__c> app){
for(application__c a:app){
a.newcustmer__c='2015-0037';
}
update app;
}
global void finish(database.BatchableContext bc){
}
}
program is exeuted but requir ment is not met
do this for me
global class batchapexforlookup implements database.Batchable<sobject> {
list<custmer__c> c;
global void batchapexforlookup(){
c=new list<custmer__c>();
}
global database.Querylocator start(database.batchablecontext bc){
return database.getQueryLocator('select area__c,digit__c,newcustmer__r.Name from application__c');
}
global void execute(database.batchablecontext bc,list<application__c> app){
for(application__c a:app){
a.newcustmer__c='2015-0037';
}
update app;
}
global void finish(database.BatchableContext bc){
}
}
The above line will not work. You need to pass the record id instead of record name.