function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gokul Pillai 1Gokul Pillai 1 

How to update a custom field on contact when an Opportunity is marked as 'Closed Won'?

SwethaSwetha (Salesforce Developers) 
HI Gokul,
You can use a simple workflow rule https://help.salesforce.com/articleView?id=workflow_managing_field_updates.htm&type=5 to update the field.

You can also opt trigger approach as mentioned in https://salesforce.stackexchange.com/questions/79874/update-contact-customfield-when-opportunity-is-created-or-updated

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Gokul Pillai 1Gokul Pillai 1
Thanks for the help Swetha, I don't think workflow rule will be a option here as Opportunity and Contact objects are not directly linked so I was thinking of there is another way to do this non programitically but I will go ahead and creater a trigger for achieving this requirement

Thanks!
jaya raghunathjaya raghunath
Hi Gokul, 

you can create a lookup relation in  between Contact and Opporunty. Then try put Workflow rule on Contact Object.
in workflow action we have different actions like
1)New Task
2)New Email Alert
3)Field Update 
4)New Outbound Message
5)Select Existing action
 
Since we are doing field update over here so Choose Field update And Select Opportunity as closed won