function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShreyankaShreyanka 

Apex class to auto populate contact mailing address with account Billing address

Hi Everyone,
I am new to Apex, please help me in writing apex class for " auto populating contact mailing address with account Billing address".

Thanks in advance!
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shreyanka,

Can you confirm if you want the logic when a contact is created first . Do you want it as Apex trigger?

Thanks,
 
ShreyankaShreyanka
Hi Sai Praveen,
--> I want a method not trigger, so that i can call that method in trigger.
--> I want logic when contact is created first and then if we update related account's Billing address it should get populated to contact mailing address only if chechbox field is set true on contact.

Thanks,
Shreyanka