CRM Crate

What is an Activity Party in Dynamics 365 / Power Apps?

We will understand the concept of an Activity Party in Dynamics 365 / Power Apps. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Apps.

What is an Activity Party in Dynamics 365 / Power Apps?

What is an Activity Party in D365 / Power Apps?

An Activity Party is a special entity / table which is used to store the parties associated with any activity type. It represents a person or group associated with an activity. An activity can have multiple activity parties.

Below are the different types of parties and their significance.

Activity party typeValueDescription
Sender1Specifies the sender.
ToRecipient2Specifies the recipient in the To field.
CCRecipient3Specifies the recipient in the Cc field.
BccRecipient4Specifies the recipient in the Bcc field.
RequiredAttendee5Specifies a required attendee.
OptionalAttendee6Specifies an optional attendee.
Organizer7Specifies the activity organizer.
Regarding8Specifies the regarding item.
Owner9Specifies the activity owner.
Resource10Specifies a resource.
Customer11Specifies a customer.

Not all types are available for each activity in Dynamics 365 for Customer Engagement, except for a custom activity. Below is the list of activity party types that are supported for each out of the box activity, and the corresponding activity properties to specify those activity party types.

Activity entity nameSupported activity party typeActivity attribute
AppointmentOptionalAttendee
Organizer
RequiredAttendee
Appointment.OptionalAttendees
Appointment.Organizer
Appointment.RequiredAttendees
CampaignActivitySenderCampaignActivity.Partners
CampaignActivity.From
CampaignResponseCustomerCampaignResponse.Customer
CampaignResponse.Partner
CampaignResponse.From
EmailBccRecipient
CcRecipient
Sender
ToRecipient
Email.Bcc
Email.Cc
Email.From
Email.To
FaxSender
ToRecipient
Fax.From
Fax.To
LetterBccRecipient
Sender
ToRecipient
Letter.Bcc
Letter.From
Letter.To
PhoneCallSender
ToRecipient
PhoneCall.From
PhoneCall.To
RecurringAppointmentMasterOptionalAttendee
Organizer
RequiredAttendee
RecurringAppointmentMaster.OptionalAttendees
RecurringAppointmentMaster.Organizer
RecurringAppointmentMaster.RequiredAttendees
ServiceAppointmentCustomer
Resource
ServiceAppointment.Customers
ServiceAppointment.Resources

Method for reading / getting parties using JavaScript

We will build a Web API query “retrieveMultipleRecords” for retrieving the value from a party. Below are the list of parameters required in our query.

Parameter NameParameter Value
activityIdThis will be the unique identified or GUID of the Activity record (letter/email/phone call etc.)
participationtypemaskThis value can be selected as per the type of activity party as shown in the above table
partyId This will be the GUID of the primary entity which is associated with the activity entity

Below is the Web API Query build using the above details.

(async (entityId)=>{
       const activityEntity=await Xrm.Web API.retrieveMultipleRecords("activityparty", "?$filter=_activityid_value eq " + 
       entityId + " and participationtypemask eq 2&$select=_partyid_value,_activityid_value");
       activityEntity.entities
        .map(x => ({
            id: x._partyid_value, 
            entityLogicalName: x['_partyid_value@Microsoft.Dynamics.CRM.lookuplogicalname'], 
            Name: x['_partyid_value@OData.Community.Display.V1.FormattedValue']}))
        .forEach(console.log);  
    }
)('Your entity ID');

The above JavaScript snippet will provide the below given output –

1.	0: {id: "fa8c129e-31b4-e911-a99d-000d3ab34f96", entityLogicalName: "account", Name: "Prashant Tirlotkar"}
2.	1: {id: "0f2ba5cd-35b4-e911-a996-000d3ab311g9", entityLogicalName: "contact", Name: "Omkar Rane"}
3.	2: {id: "7ca6600e-3cb4-e911-a99d-000d3ab31f4r", entityLogicalName: "contact", Name: "Priya Gupta"}

Thus, we learned the significance of an Activity Party entity and a way to retrieve its data.

5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.