+ Start a Discussion
Roy SinghRoy Singh 

Trigger to update account name in case and task record when i change account name in contact record

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. Example Case record and Task record account name should be changed whenever i change account name on contact record.

Thanks,
Sumeet_ForceSumeet_Force
,Using SOQL, fetch related records for Case and Task and fire DML after updating the account ID there with the new values.
Sumeet_ForceSumeet_Force
These basics can be easily found in the Apex PDFs help guides.
https://resources.docs.salesforce.com/198/latest/en-us/sfdc/pdf/apex_workbook.pdf