2

我想使用 MS Dynamics Web API 创建电子邮件。

我在这里发布数据

{
  "sender": "test@test.com",
  "torecipients": "test2@test.com",
  "subject": "Test Subject New 1234567",
  "description": "Test Description New 1234567"
}

发件人收件人未反映在 Dynamics CRM 中。仅显示主题描述

有什么我想念的吗?

4

1 回答 1

3

您必须填充集合值导航属性email_activity_parties以填充FromTo字段。sender&torecipients是仅用于报告目的的字段,带有这些活动方的电子邮件地址。

    var email = {};
    email["subject"] = "Email demo from Web API";
    email["description"] = "This a web api test";
    email["regardingobjectid_contact@odata.bind"] = "/contacts(C41CE33F-D0A0-E611-811E-5065F38C8781)";

    //activityparty collection
    var activityparties = [];
    //from party
    var from = {};
    from["partyid_systemuser@odata.bind"] = "/systemusers(8D23B2C1-9869-4C3F-9A80-BA51375C1784)";
    from["participationtypemask"] = 1;

    //to party
    var to = {};
    to["partyid_contact@odata.bind"] = "/contacts(C41CE33F-D0A0-E611-811E-5065F38C8781)";
    to["participationtypemask"] = 2;

    activityparties.push(to);
    activityparties.push(from);

    //set to and from to email
    email["email_activity_parties"] = activityparties;

阅读更多

编辑

JSON 将如下所示:

{
  "subject": "Test Subject New 1234567",
  "description": "Test Description New 1234567",
  "regardingobjectid_contact@odata.bind": "/contacts(<GUID>)",
  "email_activity_parties": [
    {
      "partyid_contact@odata.bind": "/contacts(<GUID>)",
      "participationtypemask": 2
    },
    {
      "partyid_systemuser@odata.bind": "/systemusers(<GUID>)",
      "participationtypemask": 1
    }
  ]
}
于 2018-05-11T15:12:41.667 回答