Skip to main content

Notifications

Customer Service forum

ActivityParty in Dynamics 365 online

Posted on by Microsoft Employee

I am trying to write a custom code and require the use of ActivityParty class. However, I am not able to  know what is the namespace of this class.

Anyone have any clues? Thanks for helping.

Categories:
  • Verified answer
    Somesh2207 Profile Picture
    Somesh2207 1,563 on at
    RE: ActivityParty in Dynamics 365 online

    Hi Kentan,

    I am not sure what you want exactly, but below is the code of creating email records in CRM consisting of activity party. Let me know if you need something else.

    // Create a new activity party linked to a contact
    Entity party1 = new Entity("activityparty");
    party1["addressused"] = "some@email.com";
    party1["partyid"] = new EntityReference("contact", contactId);
    
    // 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 to = new EntityCollection();
    to.Entities.Add(party1);
    to.Entities.Add(party2);
    
    // Create an email with the EntityCollection
    Entity email = new Entity("email");
    email["subject"] = "Test Party Lists";
    email["to"] = to;
    
    _sdk.Create(email);


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ActivityParty in Dynamics 365 online

    Custom code is in C#. Thanks.

  • Somesh2207 Profile Picture
    Somesh2207 1,563 on at
    RE: ActivityParty in Dynamics 365 online

    Hi Kentan, Can you elaborate what exactly you want,  or if the custom code is C# plugin or JavaScript ?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans