Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

(oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

(0) ShareShare
ReportReport
Posted on by

We are pulling Appointment data from dynamics 365 online into PowerBI.

An Appointment can have many Required Attendees and each of these can be a different entity, an account, a contact etc etc.

We can get the Appointment, and the ActivityParties, but there is no data to say what type of entity each row in the activityParties table is.
Whats worse is that although the ActivityParties result contains recordSets, for example partid_Contact, when we drill into that, we get an error:


"The 'Retrieve' method does not support entities of type 'activityparty

The party in question is a contact, i know this as i set up a specific example, so i assumed this record set should contain the contact details for this contact.

Is this a not possible yet, or is there a way to get this information?

*This post is locked for comments

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: (oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

    Can't you just get all of them from webAPI and simply filter them out in Power BI? Not everything can be done in WebAPI, I guess that getting the information about the type of ActivityPointers was what you wanted, now it's a Power BI task to filter out the proper data (unless of course it can be done in WebAPI, but in this case I wouldn't do that, in case I need this contacts for some other reports.

  • wilson_smyth Profile Picture
    wilson_smyth on at
    RE: (oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

    Thanks, this has been helpful, and i am making progress. Using the CrmRestBuilder in particular is very helpful.
    I could use a pointer, as i cant seem to see an answer in the ms documentation.

    im getting activiyParties & related accounts and contacts. I want to filter out any values that do not have a value for contact, but none of the syntax ive tried works, most recent one is below:

    myCRM.dynamics.com/.../activityparties$select=participationtypemask,_partyid_value&$expand=partyid_account($select=emailaddress1,emailaddress2,emailaddress3),partyid_contact($select=emailaddress1,emailaddress2,emailaddress3)&$filter=partyid_contact ne null

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: (oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

    I understand that completely and I'm just saying that you can get that information using WebAPI. I'm just looking at the query results in WebAPI (the query that I posted previously, simply getting all ActivityParties for entity) and there it is:

    _partyid_value@Microsoft.Dynamics.CRM.lookuplogicalname:"contact"

    _partyid_value:"d23a9055-eb00-e811-a974-000d3ab4580a"

    That's why I'm told you that you should use it :) Read the article I linked, it tells how to get for example formatted name from WebAPI - you can do the same for getting _partyid_value@Microsoft.Dynamics.CRM.lookuplogicalname.

    To be honest, you can do pretty much everything using Power BI regarding D365 data - it's just not that simple as putting D365 in Power BI Desktop and clicking few times to get everything. Sometimes it requires to dig a little bit deeper, but I guess it works that way not only in MS world...

  • wilson_smyth Profile Picture
    wilson_smyth on at
    RE: (oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

    Hi Paul. thanks for the response.

    I can get the activity party records, that is not the issue.

    The issue is that I don't know which type of entity each Activity party is referencing.

    e.g. say I have an appointment and it has 2 accounts and a contact as required participants. There will be 3 activity parties, each with ParticipationTypeMask of 5, but no way of telling which record is a contact, and which is an account, so I cant build a model from which to report from in PowerBi.

    Regarding the participationTypeMask, it tells me if an ActivityParty row is a required attendee, but it does not tell me what type of entity the party is, i.e. is it a contact, an account or some custom entity, and it does not give the ID that I can use to find the entity.

    Microsoft sold us Dynamics 365 based on the assumption we could easily run reports on top of it using PowerBI to have visibility as to how business processes are doing. This is not the case and the link between PowerBI & CRM Online is half baked at best. Its a shame because it has for the moment put a halt to our plans of migrating our processes to CRM Onine.

    I will investigate using the webAPI, it may give enough functionality to get us moving again. Thanks!

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: (oData/web query) how to find the type of entity that is stored in an Activity party in Dynamics 365

    Well first of all, I guess you are using the Dynamics 365 ODATA feed in your Power BI solution. I'm not PBI expert but I always ended up using Dynamics 365 WebAPI instead, because using the feed is just too slow (if you will check with some Fiddle how much unnecessary data is downloaded you will think the same). How I usually do things with PBI and D365 is not to use this magic "D365" data source in Power BI, rather use simply WebAPI so as your data source use "Web". This article can get you started:

    community.dynamics.com/.../powerbi-deep-dive-using-the-web-api-to-query-dynamics-crm-365-for-enterprise

    Having said that, you can easily get the activity party from WebAPI in power BI, for instance like that:

    crmorg/.../activityparties$filter=_activityid_value eq 130E1C7C-A502-E811-A976-000D3AB4580A

    This simply gets the activity parties for activity with given Id. In the result there will be a field called "participationtypemask" and value "5" is required attendee. Of course you can have two datasets - one with Appointment, one with ActivityParties and to the joining in Power BI, or you can join the data even if properly executing WebAPI.

    Using the default "Dynamics 365" data source is easy, but I believe that it is only for demo purposes, not real live solutions because it lacks a lot of functionality. Using properly WebAPI gives you filtering (in data source not in Power BI) and reduces the amount of data you get, you can get names for option sets values etc. Much more flexible solution (but unfortunately requires more understanding of WebApi, but here RestBuilder which is described in the article comes to the rescue)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans