You need to sign in to do that
Don't have an account?
Roy Singh
Trigger on contact object when i change account name
Hi All,
I need to write trigger on contact object.
My problem is whenever i change the account name from in existing contact record then all account name should be changed related to contact object record like case and task. In case record and task record account name should be changed whenever i change account name on contact record.
Thanks,
I need to write trigger on contact object.
My problem is whenever i change the account name from in existing contact record then all account name should be changed related to contact object record like case and task. In case record and task record account name should be changed whenever i change account name on contact record.
Thanks,
try below code and let me know if it doesn't work
I tried it and it is working for me
The solution given by Jayshil will work fine unless and until you do not have Bulk contact records getting their Account Name changed. If it does, then it will hit the governor limit of 100 SOQL in a Transaction as he has used SOQL inside a FOR loop.
Please check the below Trigger and let me know if it works for you. It abides by all the Governor limit and is bulkified as well.
Please let me know if it works or you need any more assistance.
Please mark this as the solution to help Community grow and move this question out of the Unsolved list.
Thanks & Regards,
Jainam Contractor,
Salesforce Consultant,
Varasi LLC
www.varasi.com
1. if you want to chagne account for contact. write trigger on contact only.
2. if you want to edit the account name of contact. no need to write trigger on contact. just write on account...
because of.....
1. relation between objects is based on ID's not on labels....