how to update lookup field primary contact on opportunity to contact when status is submitted automatically corresponding contact isprimary field is checked by using trigger - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
divya gourigaridivya gourigari 

how to update lookup field primary contact on opportunity to contact when status is submitted automatically corresponding contact isprimary field is checked by using trigger

Amnon KruviAmnon Kruvi
Do Divya,

You can achieve this with either a flow or code trigger.

If you take the flow path, you will need to create a lookup step to query any contact roles related to the opportunity, where the Is Primary field is selected. You can then get the contact ID, set it on the opportunity record, and save it.