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

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Copy email from one entity to another

    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.

  • erhan.keskin Profile Picture
    erhan.keskin 2,253 on at
    RE: Copy email from one entity to another

    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,

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans