web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Copy email from one entity to another

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I'm writing a plugin (C#) to copy notes and emails from leads to opportunities. The notes part workd but I can't find any way to copy the emails from the lead to the opportunity.

- When I try to fetch the email and then create a new one, I get a duplicate record-error.

- if I try to copy the activitypointer (for that email) then I get "Create' method does not support entities of type 'activitypointer'"

Can anyone tell me how I can copy the emails of a lead to an opportunity? Or link the same email to both entities would also be ok.

 

Thanks in advance,

Kind regards,

Erik

I have the same question (0)
  • erhan.keskin Profile Picture
    2,253 on at

    Hi,

    How do you copy the email? You need to create Activity Parties and assign the existing one's values.For Instance;

    Entity email = new Entity("email");
    Entity fromParty = new Entity("activityparty");
    Entity toParty = new Entity("activityparty");

    toParty["partyid"] = new EntityReference(entityname, entityid); [EntityReference of existing email's "to"]
    fromParty["partyid"] = new EntityReference("systemuser", userid);   [EntityReference of existing email's "from"]
    email["from"] = new Entity[] { fromParty };
    email["to"] = new Entity[] { toParty };

    email["subject"] = [existing email's "subject"]
    email["description"] = [existing email's "description"]
    email["regardingobjectid"] = new EntityReference("opportunity", opportunityId); [EntityReference of opportunity]

    Regards,

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Erik,

    Is it CRM Online? Are you tring to create emails on lead qualify to opportunity? If yes then you dont need a plugin as this is an out of box functionality.

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans