Hi Experts, Iam created text field name is Account Owner in contact object.When i change account owner in Account Object that will affeted on the account owner field in contact Object?( How to write trigger please eplain each and every step?)
Use formula field instead of trigger. Don't user trigger for sunch small stuff. Create one formula text field on contact. Assign Account.OwnerId to newly created forumula text field.
Actually you need to retrive AccountId with contact variable .You can replac the code like below . accMap.get(AccountId).OwnerId; to accMap.get(con.AccountId).OwnerId;
Please try below code to update contact field on after account udate .
Please make this as solution if this will help you.
Tryt with below code and let me know if you hav eany doubt .I think you can understand eaisly .
Thanks
Manoj
Use formula field instead of trigger. Don't user trigger for sunch small stuff. Create one formula text field on contact. Assign Account.OwnerId to newly created forumula text field.
Thanks,
dinesh
Try with below code
Actually you need to retrive AccountId with contact variable .You can replac the code like below .
accMap.get(AccountId).OwnerId; to accMap.get(con.AccountId).OwnerId;
Thanks
Manoj