You need to sign in to do that
Don't have an account?
Sonu06
Birthdate Update
Hi guys I am new to the salesforce, my requirement is I want to write a trigger.
Trigger:- I want to update the birthday field Of Account with the Birthday of recently(latest) created Contact birthday of respective Account.
(this should work on insert, update and delete)
example- Suppose my account has 3 contacts created 1,2,3 in a row that means 3 is my recently created contact, so suppose I delete 3rd contact, then birthday of account should be change to birthday of 2nd contact .
Suppose i update the account of contact, then respective birthday should be change with latest contact birthday.
Note- plz do not share any link, if possible give me explanation with trigger.
Thank you
Trigger:- I want to update the birthday field Of Account with the Birthday of recently(latest) created Contact birthday of respective Account.
(this should work on insert, update and delete)
example- Suppose my account has 3 contacts created 1,2,3 in a row that means 3 is my recently created contact, so suppose I delete 3rd contact, then birthday of account should be change to birthday of 2nd contact .
Suppose i update the account of contact, then respective birthday should be change with latest contact birthday.
Note- plz do not share any link, if possible give me explanation with trigger.
Thank you
I have soled your question.
Note= I have create custom field Birthdate in Account Object.
----Trigger-----
----Apex Class--------
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com