+ Start a Discussion
chandra prakash 58chandra prakash 58 

Want to create a batch class on the custom object

Want to create a batch class on the custom object (enquiry__c) having lookup with the account. When enqiry__c  lookup field(City__c and State__c) get  matched with same field in Account object  then Account name  will get reflected in dealer(lookup field with account object) in  enquiry__c object. Please help to code this.
ShirishaShirisha (Salesforce Developers) 
Hi Chandra,

Greetings!

Please refer the below blog for the sample code to create the batch class according to your requirement.

https://www.sfdcamplified.com/2019/04/update-account-and-related-contacts-using-batch-and-scheduled-apex.html

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
chandra prakash 58chandra prakash 58

Thanks, Shirisha,

In this blog,  there is no lookup field updating based upon other lookup field value.