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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 123

#2
Hamza H Profile Picture

Hamza H 96 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 66 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans