在Dynamics-Web-API中,使用批处理时,如何将Content-ID用作更新请求的关键?
版本: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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 deep Insert 创建帐户并联系记录并链接它们。
You can use the deep insert to create account and contact record and link them.