You need to sign in to do that
Don't have an account?

if account billing address is update then related contact mailingaddress is also update???
if account billing address is update then related contact mailingaddress is also update???
You need to sign in to do that
Don't have an account?
All Answers
Try below trigger code Related: https://developer.salesforce.com/forums/?id=906F0000000AxLvIAK
https://developer.salesforce.com/forums/?id=906F0000000kGOuIAM
If this information helps, please mark the answer as best. Thank you
Try like this.
trigger AccountTrigger02 on Account (after insert,after update) {
if(Trigger.isAfter && Trigger.isInsert){
list<Account> lisAcc = new list<Account>();
list<Contact> listContacts = new list<Contact>();
map<Id,Account> mapOldAcc = new map<Id,Account>();
set<id> accids = new set<id>();
for(Account acc : trigger.new){
System.debug('===Old phone Number==='+mapOldAcc.get(acc.id).BillingAddress);
Account oldacc = mapOldAcc.get(acc.id);
if(oldacc.BillingAddress != acc.BillingAddress){
accids.add(acc.id);
}
}
list<contact> listCons = [SELECT Id,Name,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,
AccountId,Account.BillingStreet,Account.BillingCity,Account.BillingState,Account.BillingPostalCode,
Account.BillingCountry FROM Contact WHERE accountid in : accids];
for(Contact con : listCons){
con.MailingStreet = con.account.BillingStreet;
con.MailingCity = con.account.BillingCity;
con.MailingState = con.account.BillingState;
con.MailingPostalCode = con.account.BillingPostalCode;
con.MailingCountry = con.account.BillingCountry;
listContacts.add(con);
}try{
if(listContacts.size() > 0 || listContacts.isEmpty()){
update listContacts;
}
}Catch(DMLException e){
System.debug('Following error message occured'+e);
}
}
}