2

我已成功使用$batchDynamics 365 Web API 的端点创建了许多约会。

https://myorg.com/api/data/v8.2/$batch

请求正文如下所示:

--batch_AAA123
Content-Type: multipart/mixed;boundary=changeset_BBB456

--changeset_BBB456
Content-Type: application/http
Content-Transfer-Encoding:binary
Content-ID: 1

POST https://myorg.com/api/data/v8.2/appointments HTTP/1.1
Content-Type: application/json;type=entry

{ ... JSON for appointment ... }

--changeset_BBB456
Content-Type: application/http
Content-Transfer-Encoding:binary
Content-ID: 2

POST https://myorg.com/api/data/v8.2/appointments HTTP/1.1
Content-Type: application/json;type=entry

{ ... JSON for appointment ... }

--changeset_BBB456--

--batch_AAA123--

appointments我不想使用端点,而是使用该Book操作。

https://myorg.com/api/data/v8.2/Book

我可以单独成功地做到这一点:

{
  "Target": {
    "@odata.type": "Microsoft.Dynamics.CRM.appointment",
    "subject": "Created using Book action",
    "scheduledstart" : "2018-01-18T09:00:00Z",
    "scheduledend": "2018-01-18T10:00:00Z",
    "statecode" : 3,
    "statuscode" : 5,
    "ownerid@odata.bind":"/systemusers(f6c98954-66d3-e711-80eb-3863bb342b28)",
    "appointment_activity_parties" : [
    {
      "partyid_systemuser@odata.bind" : "/systemusers(f6c98954-66d3-e711-80eb-3863bb342b28)",
      "participationtypemask" : 7
    }
    ],
    "regardingobjectid_account@odata.bind": "/accounts(8df157f6-fcf5-e711-80ef-3863bb34ecf0)"
  }
}

现在我想通过操作使用该Book操作,$batch但出现错误:

VerifyCommitted - 事务尚未提交

除了长长的堆栈跟踪之外,没有更多细节。

我相信如果单独进行预订会成功(没有日程安排冲突等)

我做错了什么还是 Web API 根本不支持批量操作?

4

0 回答 0