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
MORDECKAI MOUYALMORDECKAI MOUYAL 

How To Transfer The Contact Email Address To A New Opportunity Field

hello i need your help!
i need to have a field in opportunity that copy in it  the email from the contact 
Rajneesh Ranjan 23Rajneesh Ranjan 23
Hi MORDECKAI MOUYAL,

I think you have to write a trigger for this but before you start, I have one question for you -
As per my understanding, an Opportunity will have one Account, but one Account may have multiple contacts. So, how you want to filter out the related Contacts, i.e. if there are multiple Contacts associated with single Account then which Email you want on your Opporunity Field.

Thanks,
Rajneesh 
Vijay NagarathinamVijay Nagarathinam
Hi Modreckai,

If you org enabled person account then the person account will be act as account as well contact.

Use the below formula : Account.PersonEmail.

If you not enable the personaccount, then you need to write a trigger before insert and before update event.

Thanks,
Vijay