Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

can't able to create email activity with CC field

(0) ShareShare
ReportReport
Posted on by 1,000

I need to create email activity with cc field,I use the following code for add values in cc field it throws the error

       string ccDetails ="<Guid1 here>,<guid2 here>"

string[] splitCCIds = ccDetails.Split(',');
EntityCollection collCcParty = new EntityCollection();
foreach (var ccId in splitCCIds)
{
EntityReference cc = new EntityReference("systemuser", new Guid(ccId));
Entity ccParty = new Entity("activityparty");
collCcParty.EntityName = "systemuser";
collCcParty.Entities.Add(ccParty);
}
email.Attributes.Add("cc", collCcParty);

Error: I got the following error.

Cannot create activity party: either partyid or addressused field should be present

But I use the same code for add the values in "To" field its working fine.How can I add the values in cc Field.

*This post is locked for comments

  • Verified answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: can't able to create email activity with CC field

    Hi

    you have to use partyid

    collCcParty["partyid"] = new EntityReference("systemuser", new Guid("5ACD43CE-4C09-E211-8627-E06995886FCB"));

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,076 on at
    RE: can't able to create email activity with CC field

    Hi Vijay,

    Please try the code below.

    //Create a activity party
    Entity party1 = new Entity("activityparty");
    party1["addressused"] = "some@email.com"; party1["partyid"] = new EntityReference("systemuser", systemUserId); // Create a new unresolved activity party Entity party2 = new Entity("activityparty"); party2["addressused"] = "unresolved@email.com"; // Create a new EntityCollection and add the 2 parties EntityCollection cc = new EntityCollection(); cc.Entities.Add(party1); cc.Entities.Add(party2); // Create an email with the EntityCollection Entity email = new Entity("email"); email["subject"] = "Test Party Lists"; email["cc"] = cc; _sdk.Create(email);

    Refer the links below.

    http://www.magnetismsolutions.com/blog/paulnieuwelaar/2015/09/07/working-with-dynamics-crm-activity-party-lists-in-c--plugins

    https://social.microsoft.com/Forums/en-US/49eb1f64-c7d1-42a9-b3f0-abd1205e651a/cannot-create-activity-party-either-partyid-or-addressused-field-should-be-presentdetail?forum=crmdevelopment

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,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans