Skip to main content
sandeep reddy 님이 #Apex에 질문했습니다
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){

        

    }

} 
답변 1개
  1. 2016년 4월 7일 오전 6:48
    a.newcustmer__c='2015-0037';

    The above line will not work. You need to pass the record id instead of record name.