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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

WEB API 8.2 Activity Party Lookups Issue

(0) ShareShare
ReportReport
Posted on by 2,585

Hello Folks,

Issue: When we upgraded our CRM to 365(8.2) we found issue with Email Activities Party.

To get email details such as To , From, CC, Bcc we have used FetchXML in CRM WEB API. It had worked in WEB API v8.0.

Now email activity parties do not show in v8.2. 

Could anyone suggest on this issue? has anyone faced this similar issue? Any thought?

Thank You

 

*This post is locked for comments

I have the same question (0)
  • Andreas Cieslik Profile Picture
    9,267 on at

    Could you please provide the full or a simplied version of your request so we can validate that request?

  • omgcrm Profile Picture
    2,585 on at

    Hi @andreas

    Assume this as the sample fetchxml request sent through WEB APi v8.2

    This Email has From, To , Bcc, Cc set.

    FetchXML:

     <entity name="email">

       <attribute name="subject" />

       <attribute name="regardingobjectid" />

       <attribute name="from" />

       <attribute name="to" />

       <attribute name="prioritycode" />

       <attribute name="statuscode" />

       <attribute name="modifiedon" />

       <attribute name="activityid" />

       <attribute name="cc" />

       <attribute name="bcc" />

       <order attribute="subject" descending="false" />

       <filter type="and">

         <condition attribute="activityid" operator="eq" uiname="Welcome Email CRM:00000000025000001993" uitype="email" value="{04F725F9-BAE3-E611-80FC-5065F38A3921}" />

       </filter>

     </entity>

    </fetch>

    Can you confirm whether you are able to retrieve the Bcc and cc fields details?

    If it does not work via fetchXML, Could you please suggest other ways to retrieve the Activity party details.

    Thank you

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    What is the error message you are getting?

  • omgcrm Profile Picture
    2,585 on at

    Hi @Gopalan

    We are not getting any error message.

    RESULT:

    {

        "@odata.context": "https://test.com/api/data/v8.0/$metadata#emails(statecode,_regardingobjectid_value,statuscode,description,createdon,subject,directioncode,_ownerid_value,modifiedon,prioritycode,_transactioncurrencyid_value,_modifiedby_value,actualstart,activitytypecode,deliveryprioritycode,_createdby_value,sw_actiontypeid,activityid,actualdurationminutes,email_activity_parties)",

        "value": [

            {

                "@odata.etag": "W/\"21162999\"",

                "statecode@OData.Community.Display.V1.FormattedValue": "Open",

                "statecode": 0,

                "_regardingobjectid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "regardingobjectid_incident_email",

                "_regardingobjectid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "incident",

                "_regardingobjectid_value@OData.Community.Display.V1.FormattedValue": "SM CT June05 Test012 SHIELD ",

                "_regardingobjectid_value": "762f3fd2-ea49-e711-80fd-5065f38bc301",

                "statuscode@OData.Community.Display.V1.FormattedValue": "Draft",

                "statuscode": 1,

                "description": "sfsfsdfsdfsd",

                "createdon@OData.Community.Display.V1.FormattedValue": "06/06/2017 11:56",

                "createdon": "2017-06-06T06:26:45Z",

                "subject": "Email test",

                "directioncode@OData.Community.Display.V1.FormattedValue": "Outgoing",

                "directioncode": true,

                "_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",

                "_ownerid_value@OData.Community.Display.V1.FormattedValue": "Swapna Manoj",

                "_ownerid_value": "490fab75-dcf1-e611-80fe-5065f38b0491",

                "modifiedon@OData.Community.Display.V1.FormattedValue": "06/06/2017 11:57",

                "modifiedon": "2017-06-06T06:27:16Z",

                "prioritycode@OData.Community.Display.V1.FormattedValue": "Normal",

                "prioritycode": 1,

                "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "transactioncurrencyid_email",

                "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "transactioncurrency",

                "_transactioncurrencyid_value@OData.Community.Display.V1.FormattedValue": "UK Pound Sterling",

                "_transactioncurrencyid_value": "901c0ef6-140e-e411-b46d-2c59e541ad14",

                "_modifiedby_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",

                "_modifiedby_value@OData.Community.Display.V1.FormattedValue": "Swapna Manoj",

                "_modifiedby_value": "490fab75-dcf1-e611-80fe-5065f38b0491",

                "actualstart@OData.Community.Display.V1.FormattedValue": "06/06/2017",

                "actualstart": "2017-06-06T06:26:45Z",

                "activitytypecode@OData.Community.Display.V1.FormattedValue": "Email",

                "activitytypecode": "email",

                "deliveryprioritycode@OData.Community.Display.V1.FormattedValue": "Normal",

                "deliveryprioritycode": 1,

                "_createdby_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",

                "_createdby_value@OData.Community.Display.V1.FormattedValue": "Swapna Manoj",

                "_createdby_value": "490fab75-dcf1-e611-80fe-5065f38b0491",

                "sw_actiontypeid@OData.Community.Display.V1.FormattedValue": "Acknowledgement of Chase",

                "sw_actiontypeid": 266880001,

                "activityid": "1d71a518-814a-e711-80fe-5065f38bc341",

                "actualdurationminutes@OData.Community.Display.V1.FormattedValue": "30",

                "actualdurationminutes": 30,

                "email_activity_parties": [

                    {

                        "@odata.etag": "W/\"21162990\"",

                        "_partyid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "partyid_queue",

                        "_partyid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "queue",

                        "_partyid_value@OData.Community.Display.V1.FormattedValue": "VOMain Email",

                        "_partyid_value": "9d44d103-b9cc-e411-80f6-c4346bad20a4",

                        "_activityid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "activityid_activitypointer",

                        "_activityid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "activitypointer",

                        "_activityid_value": "1d71a518-814a-e711-80fe-5065f38bc341",

                        "activitypartyid": "1f71a518-814a-e711-80fe-5065f38bc341",

                        "participationtypemask@OData.Community.Display.V1.FormattedValue": "Sender",

                        "participationtypemask": 1,

                        "_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",

                        "_ownerid_value": "490fab75-dcf1-e611-80fe-5065f38b0491",

                        "instancetypecode@OData.Community.Display.V1.FormattedValue": "Not Recurring",

                        "instancetypecode": 0,

                        "ispartydeleted@OData.Community.Display.V1.FormattedValue": "No",

                        "ispartydeleted": false,

                        "addressusedemailcolumnnumber@OData.Community.Display.V1.FormattedValue": "5",

                        "addressusedemailcolumnnumber": 5,

                        "addressused": "voltdev@securitywatchdog.org.uk"

                    },

                    {

                        "@odata.etag": "W/\"21162993\"",

                        "donotemail@OData.Community.Display.V1.FormattedValue": "Allow",

                        "donotemail": false,

                        "_partyid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "partyid_contact",

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

                        "_partyid_value@OData.Community.Display.V1.FormattedValue": "BK3 D3",

                        "_partyid_value": "12c01c16-290e-e711-80f9-5065f38b6471",

                        "_activityid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "activityid_activitypointer",

                        "_activityid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "activitypointer",

                        "_activityid_value": "1d71a518-814a-e711-80fe-5065f38bc341",

                        "activitypartyid": "2271a518-814a-e711-80fe-5065f38bc341",

                        "donotpostalmail@OData.Community.Display.V1.FormattedValue": "Allow",

                        "donotpostalmail": false,

                        "participationtypemask@OData.Community.Display.V1.FormattedValue": "BCC Recipient",

                        "participationtypemask": 4,

                        "_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",

                        "_ownerid_value": "490fab75-dcf1-e611-80fe-5065f38b0491",

                        "instancetypecode@OData.Community.Display.V1.FormattedValue": "Not Recurring",

                        "instancetypecode": 0,

                        "donotphone@OData.Community.Display.V1.FormattedValue": "Allow",

                        "donotphone": false,

                        "ispartydeleted@OData.Community.Display.V1.FormattedValue": "No",

                        "ispartydeleted": false,

                        "addressusedemailcolumnnumber@OData.Community.Display.V1.FormattedValue": "42",

                        "addressusedemailcolumnnumber": 42,

                        "donotfax@OData.Community.Display.V1.FormattedValue": "Allow",

                        "donotfax": false,

                        "addressused": "g@test.com"

                    },

    If you try to retrieve email records in CRM v8.2, we don't find the CC and BCC Fields data but we can see To and From fields details. This above WEB API result is from CRM V8.0

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    Hi,

    simple guess: Could it be related to the fact, that the fields CC and BCC are not marked as searchable fields?

    Cheers,

    Andreas

  • omgcrm Profile Picture
    2,585 on at

    Hi @Andreas

    I don't think it is related to Searchable fields.

    The Problem is in WEB API, we are not able to retrieve email activity parties. You could have a look at the Code pasted above!.

    Thank You

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    The returned 8.0 result does not look like as it would come from a fetchxml request?

    As workaround something like this could work also:

    var req = new XMLHttpRequest();
    req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/emails(80C07FE4-9D4A-E711-810C-70106FA7B0C1)?$select=activityid,_emailsender_value,_regardingobjectid_value,sender,_sendersaccount_value,subject,torecipients&$expand=email_activity_parties($select=activitypartyid,participationtypemask,scheduledend,scheduledstart)", true);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
    req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {
                var result = JSON.parse(this.response);
                var activityid = result["activityid"];
                var _emailsender_value = result["_emailsender_value"];
                var _emailsender_value_formatted = result["_emailsender_value@OData.Community.Display.V1.FormattedValue"];
                var _emailsender_value_lookuplogicalname = result["_emailsender_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
                var _regardingobjectid_value = result["_regardingobjectid_value"];
                var _regardingobjectid_value_formatted = result["_regardingobjectid_value@OData.Community.Display.V1.FormattedValue"];
                var _regardingobjectid_value_lookuplogicalname = result["_regardingobjectid_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
                var sender = result["sender"];
                var _sendersaccount_value = result["_sendersaccount_value"];
                var _sendersaccount_value_formatted = result["_sendersaccount_value@OData.Community.Display.V1.FormattedValue"];
                var _sendersaccount_value_lookuplogicalname = result["_sendersaccount_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
                var subject = result["subject"];
                var torecipients = result["torecipients"];
                for (var a = 0; a < result.email_activity_parties.length; a++) {
                    var email_activity_parties_activitypartyid = result.email_activity_parties[a]["activitypartyid"];
                    var email_activity_parties_participationtypemask = result.email_activity_parties[a]["participationtypemask"];
                    var email_activity_parties_participationtypemask_formatted = result.email_activity_parties[a]["participationtypemask@OData.Community.Display.V1.FormattedValue"];
                    var email_activity_parties_scheduledend = result.email_activity_parties[a]["scheduledend"];
                    var email_activity_parties_scheduledstart = result.email_activity_parties[a]["scheduledstart"];
                }
            } else {
                Xrm.Utility.alertDialog(this.statusText);
            }
        }
    };
    req.send();

  • Andreas Cieslik Profile Picture
    9,267 on at

    Could you please provide the request URL for your 8.0 request?

    Also interesting in this forum thread:

    community.dynamics.com/.../209949

  • omgcrm Profile Picture
    2,585 on at

    Hello @Andreas Cieslik Andreas

    Could you please suggest how to add CC and Bcc in query?

    After running this query

    https://deee.api.crm4.dynamics.com/api/data/v8.2/emails(04F725F9-BAE3-E611-80FC-5065F38A3921)?&$expand=email_activity_parties($select=activitypartyid,participationtypemask,scheduledend,scheduledstart)

    I am able to get From and To details but not CC and BCC details.

    Any thoughts?

    Thank You

  • Verified answer
    Andreas Cieslik Profile Picture
    9,267 on at

    I could get the cc and bcc names through the sample below.

    It is important to only use &$expand=email_activity_parties to retrieve all properties, because with select I was not able to retrieve all required.

    With alert(result.email_activity_parties[a]["_partyid_value@OData.Community.Display.V1.FormattedValue"]);

    I can display the party (bcc or cc content) member.

    With alert(email_activity_parties_participationtypemask_formatted); you could also display if its the bcc or cc party.

    var req = new XMLHttpRequest();

    req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/emails(80C07FE4-9D4A-E711-810C-70106FA7B0C1)?$select=activityid,_emailsender_value,_regardingobjectid_value,sender,_sendersaccount_value,subject,torecipients&$expand=email_activity_parties", true);

    req.setRequestHeader("OData-MaxVersion", "4.0");

    req.setRequestHeader("OData-Version", "4.0");

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");

    req.onreadystatechange = function() {

       if (this.readyState === 4) {

           req.onreadystatechange = null;

           if (this.status === 200) {

               var result = JSON.parse(this.response);

               var activityid = result["activityid"];

               var _emailsender_value = result["_emailsender_value"];

               var _emailsender_value_formatted = result["_emailsender_value@OData.Community.Display.V1.FormattedValue"];

               var _emailsender_value_lookuplogicalname = result["_emailsender_value@Microsoft.Dynamics.CRM.lookuplogicalname"];

               var _regardingobjectid_value = result["_regardingobjectid_value"];

               var _regardingobjectid_value_formatted = result["_regardingobjectid_value@OData.Community.Display.V1.FormattedValue"];

               var _regardingobjectid_value_lookuplogicalname = result["_regardingobjectid_value@Microsoft.Dynamics.CRM.lookuplogicalname"];

               var sender = result["sender"];

               var _sendersaccount_value = result["_sendersaccount_value"];

               var _sendersaccount_value_formatted = result["_sendersaccount_value@OData.Community.Display.V1.FormattedValue"];

               var _sendersaccount_value_lookuplogicalname = result["_sendersaccount_value@Microsoft.Dynamics.CRM.lookuplogicalname"];

               var subject = result["subject"];

               var torecipients = result["torecipients"];

               for (var a = 0; a < result.email_activity_parties.length; a++) {

                   var email_activity_parties_activitypartyid = result.email_activity_parties[a]["activitypartyid"];

                   var email_activity_parties_participationtypemask = result.email_activity_parties[a]["participationtypemask"];

                   var email_activity_parties_participationtypemask_formatted = result.email_activity_parties[a]["participationtypemask@OData.Community.Display.V1.FormattedValue"];

                   var email_activity_parties_scheduledend = result.email_activity_parties[a]["scheduledend"];

                   var email_activity_parties_scheduledstart = result.email_activity_parties[a]["scheduledstart"];

                   alert(result.email_activity_parties[a]["_partyid_value@OData.Community.Display.V1.FormattedValue"]);

               }

           } else {

               Xrm.Utility.alertDialog(this.statusText);

           }

       }

    };

    req.send();

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans