在Dynamics-Web-API中,使用批处理时,如何将Content-ID用作更新请求的关键?

发布于 2025-01-20 15:48:32 字数 1234 浏览 3 评论 0原文

npm软件包: https://www.npmjs.coms.coms.com/package/package/package/package/package/package/dynamics-web-api-web-api-web-api-web-api-

版本:1.6.12

this.dynamicsWebApi.startBatch();
this.dynamicsWebApi.createRequest({
  collection: 'accounts',
  entity: createdAccountData,
  contentId: '1',
});
this.dynamicsWebApi.createRequest({
  collection: 'contacts',
  entity: {
     ...contactData,
     '[email protected]': '$1',
  },
  contentId: '2',
});
this.dynamicsWebApi.updateRequest({
  collection: 'accounts',
  key: '$1',
  entity: {
    '[email protected]': '$2',
  },
});
await this.dynamicsWebApi.executeBatch();

从上面的代码中,我打算创建一个帐户,一个链接到该帐户的联系人,最后,将帐户更新到链接到联系人。

CreateEquest 1和2可以成功执行,但是UpdatereQuest失败了错误消息“ DynamicsWebapi.executeBatch需要请求

。作为UpdatereQuest的关键?

Npm package: https://www.npmjs.com/package/dynamics-web-api

Version: 1.6.12

this.dynamicsWebApi.startBatch();
this.dynamicsWebApi.createRequest({
  collection: 'accounts',
  entity: createdAccountData,
  contentId: '1',
});
this.dynamicsWebApi.createRequest({
  collection: 'contacts',
  entity: {
     ...contactData,
     '[email protected]': '$1',
  },
  contentId: '2',
});
this.dynamicsWebApi.updateRequest({
  collection: 'accounts',
  key: '$1',
  entity: {
    '[email protected]': '$2',
  },
});
await this.dynamicsWebApi.executeBatch();

From the above code, I intend to create an account, a contact that links to the account, and finally, update the account to link to the contact.

CreateRequest 1 and 2 could execute successfully, but the updateRequest failed with the error message "DynamicsWebApi.executeBatch requires the request.key parameter to be of type String representing GUID or Alternate Key"

My question is that there is any way to use the contentId 1 as the key of the updateRequest?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴意少年 2025-01-27 15:48:32

您可以使用 deep Insert 创建帐户并联系记录并链接它们。

You can use the deep insert to create account and contact record and link them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文