Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

WEB API 8.2 Activity Party Lookups Issue

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

  • RE: WEB API 8.2 Activity Party Lookups Issue

    Can you please share how to create a email record using web api request . Means how to set to and CC list while creating record.

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    Please start separate thread/post with your question.

  • SaiKrishnaGudluru Profile Picture
    SaiKrishnaGudluru 108 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    Hi Srikanth, I'm getting "undefined" when I try to fetch  name of the look up based in guid of _partyid_value (_partyid_value@OData.Community.Display.V1.FormattedValue) i am getting undefined value rather than actual name. Please help me on this. I'm using web api for this.

    used query: 

    /api/data/v8.2/emails(12589160-9a55-e711-80e4-ecb1d78b6b00)?$select=activityid,createdon,senton,subject&$expand=email_activity_mime_attachment($select=activitymimeattachmentid,filename,filesize,_ownerid_value),email_activity_parties($select=participationtypemask,_partyid_value)

  • Verified answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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();

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

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

    Also interesting in this forum thread:

    community.dynamics.com/.../209949

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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();

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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
    Andreas Cieslik 9,265 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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
    omgcrm 2,585 on at
    RE: WEB API 8.2 Activity Party Lookups Issue

    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

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans