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
Nishigandha JadhavNishigandha Jadhav 

when opportunity is created from contact update respective contact field

I want to achieve this functionality. help me
Khan AnasKhan Anas (Salesforce Developers) 
Hi Shubhada,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.

https://success.salesforce.com/answers?id=9063A000000ZmHTQA0

https://salesforce.stackexchange.com/questions/79874/update-contact-customfield-when-opportunity-is-created-or-updated

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
sumithasumitha
Hi Shubhada,

Try to write like this.

Trigger on Contact(after insert)
{
Opportuity opp1=[select name from Opportunity];
for (Contact con: Trigger.new)
     {
       for(Opportunity opp:opp1)
          {
              if(opp.Contact = Trigger.new)
                {
                       con.Email = 'test@gmail.com';
                }

           }
update con;
      }
}

Hope it helps you.

Thanks,
Sumitha P