web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2016 Web API, how do I find entity type for Activityparty?

(0) ShareShare
ReportReport
Posted on by 125

From Javascript on the email form, I need to find the entitytype of the values in the partylist fields (from, to, regarding) of the parent email record. I'm currently trying to do this with the web API, but am not sure where to go next. I've used the following query:

"/api/data/v8.0/emails(" + parentEmailId + ")?$select=subject,_regardingobjectid_value&$expand=email_activity_parties"


This gets me some fields from the parent email record, and also the activityparty records for that email, but as shown in the web api reference here: https://msdn.microsoft.com/en-gb/library/mt607938.aspx , this does not return the entitytype of the activityparty record, e.g. contact, systemuser. 

Am i missing something here? Is there an easier way to find which type of record is in these fields?

*This post is locked for comments

I have the same question (0)
  • Saroj Das Profile Picture
    3,355 on at

    Hi,

    Can you please provide your code? So i can check what is missing.

    Thanks,
    Saroj

  • Saroj Das Profile Picture
    3,355 on at

    Hi,

    Please check the below. You will get an idea.

    scaleablesolutions.com/retrieve-activity-party-using-javascript-rest

    Thanks,

    Saroj

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Saroj Das I'm really sorry to point on obvious thing but article you provided demonstrates how to work with ActivityParties using OrganizationData endpoint and TS mentioned WebApi.

  • Saroj Das Profile Picture
    3,355 on at

    Hi Andrii,

    Thank you for pointing out this. Yes i know the requirement is on Web API instead of OData endpoint. But the select query will be same for both approach. Please correct me if i am wrong. I could have mention the query instead of complete post, sorry about that.

    In this case, I think PartyId.Name will give the Entity Name. Please advise.

    Best Regards,

    Saroj

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    So in other words uppercase that works for Odata will work for WebApi as well and to get equivalent query for WebApi based on query for OData all I need is to replace server/.../OrganizationData.svc with https://server/api/data/v8.1/

    Have I understood your reply "the select query will be same for both approach" in right way?

  • Suggested answer
    Goutham A Profile Picture
    2 on at

    Please check with activitypointer or activityparty in the query instead of email. Just add an where condition objecttypecode eq email

     [organization URI]/api/data/v8.0/activitypointers

  • Saroj Das Profile Picture
    3,355 on at

    Hi Andrii,

    Yes, you are correct.

    Best Regards,

    Saroj

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Saroj Das yes. Following queries are "100% equal".

    Odata:

    /XRMServices/2011/OrganizationData.svc/EmailSet(guid'')?$select=Subject,email_activity_parties/ParticipationTypeMask,email_activity_parties/PartyId&$expand=email_activity_parties

    WebApi:

    /api/data/v8.0/emails()?$select=subject&$expand=email_activity_parties($select=participationtypemask,partyid)

    Elliott 

    It looks like that it's not possible at the moment. May be Microsoft will give possibility to make it. Any chance you can rewrite your code to use SOAP endpoint instead of WebApi?

  • Verified answer
    Jim Daly Profile Picture
    on at

    Take a look at the activityparty._partyid_value and try using the annotations described here:

    https://msdn.microsoft.com/en-us/library/gg334767.aspx#bkmk_lookupProperty

    The lookuplogicalname should be the type.

  • Elliott Profile Picture
    125 on at

    Hi Andrii,

    Thanks for your response. I was hoping to get the partyobjecttypecode attribute, so thanks for confirming this is not possible. Hopefully Microsoft can implement this in the future.

    Regards,

    Elliott

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans