简体   繁体   English

是否可以在Dynamics中使用Web API原子地创建两个实体,然后创建第三个链接实体?

[英]Can I create two entities and then a third linking entity atomically using Web API in Dynamics?

I'm developing a NodeJS app which queries Dynamics 365 using the Web API (oData). 我正在开发一个NodeJS应用程序,该应用程序使用Web API(oData)查询Dynamics 365。

I need to create an account entity, a contact entity and then a connection entity which will link the two together. 我需要创建一个account实体,一个contact实体,然后创建一个将两者链接在一起的connection实体。 I would like this to happen atomically so that if any of these fail, then they all fail. 我希望这是原子发生的,因此,如果其中任何一个失败,那么它们都会失败。

The connection entity needs to know the accountid and contactid in advance, which means it must occur after the creation of the account and the contact connection实体需要知道accountidcontactid提前,这意味着它在创建后必须进行accountcontact

I'm aware of the batch command which lets you create multiple entities atomically but it does not look like I can pass the result of one request to the payload of another. 我知道批处理命令可以让您原子地创建多个实体,但是看起来我无法将一个请求的结果传递给另一个请求的有效负载。

Is it possible to do such a request atomically over a web interface and if not, what fallbacks could I use to approximate atomic transactions? 是否可以通过Web界面自动进行这样的请求,如果没有,我可以使用哪些后备来近似原子交易?

If I understand it correctly - You should be able to achieve this by Deep insert . 如果我正确理解-您应该可以通过Deep insert来实现。

Part 3 of my answer in this SO thread talks about reading the returned id & using in next api call. 我在这个SO线程中回答的第3部分讨论了读取返回的ID和在下一个api调用中使用的方法。 It may help your atomic record creation scenarios. 它可以帮助您创建原子记录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用SOAP API在Microsoft Dynamics CRM 2013中创建案例实体? - How can create a case entity in Microsoft Dynamics CRM 2013 using SOAP API? Dynamics 365 Web API - 如何使用 web ZDB9444238D104CADE1 注册 webhook 的步骤 - Dynamics 365 Web API - How can I register a step for a webhook using the web API? 如何仅使用原始 TSQL 而不是 Web API 和组织服务来查询 CRM Dynamics 实体? - How to query CRM Dynamics entities using raw TSQL only instead of Web API and Org Service? 使用Web API查询在Dynamics-CRM中获取实体属性值 - Fetching the entity attributes values in Dynamics-CRM using web api query 动态CRM 365 Web API身份验证,获得令牌,但我得到对实体C#的未授权调用。 净核心 - dynamics crm 365 web api authentication, got token but i get Unauthorized call to entities C# . net core 使用实体元数据早期绑定调用 Dynamics Web API - Calling Dynamics Web API with Entity metadata early binding Python 和 Dynamics CRM:使用 Web api - Python and Dynamics CRM: using a web api 使用Dynamics 365 Web Api控制台的异常 - Exception using dynamics 365 web Api Console Dynamics CRM WEB API-从实体参考中选择字段 - Dynamics CRM WEB API- Select field from entity reference 创建SPA并使用Web API连接到Microsoft CRM Dynamics Online试用版? - create a SPA using that connects to Microsoft CRM Dynamics Online trial using Web API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM