[英]How to update the record in an azure function triggered by a webhook?
I have an Azure function triggered post creation of a record in Dynamics 365 CE. 我在Dynamics 365 CE中创建记录后触发了Azure功能。 The azure function and Dynamics 365 CE are integrated by a Webhook registered via the Plugin Registration.
azure功能和Dynamics 365 CE由通过插件注册注册的Webhook集成。
What is the best way to update some data fields inside the record in RemoteExecutionContext . 更新RemoteExecutionContext中记录内部某些数据字段的最佳方法是什么。
Do I connect to Dynamics again or I can update as part of the Dynamics pipeline? 我是否再次连接到Dynamics,或者我可以作为Dynamics管道的一部分进行更新?
I have tried the .InputParameters["Target"].Id
but upon updating with a new HttpClient I am getting a record not found error, whereas the webhook is in Post. 我已经尝试了
.InputParameters["Target"].Id
我在使用新的HttpClient进行更新时遇到了记录未找到错误,而webhook在Post中。
JObject Obj1 = new JObject();
Obj1.Add(STATE, 1);
Obj1.Add(STATUS, 123);
obj1.Add(ERROR_MESSAGE, "Update");
HttpRequestMessage updateApiRequest = new HttpRequestMessage(new HttpMethod("PATCH"), $"{d365Client.BaseAddress}new_customeentity1({targetEntity.Id.ToString()})");
updateApiRequest.Content = new StringContent(obj1.ToString(), Encoding.UTF8, "application/json");
HttpResponseMessage updateResposne = await d365Client.SendAsync(updateApiRequest );
What's the best way to achieve a similar integration? 实现类似集成的最佳方法是什么? How can I update the record within the pipeline without getting the Record Not Found error?
如何在不获取Record Not Found错误的情况下更新管道中的记录?
I would check two things for solving this particular "record not found" issue: 我会检查两件事来解决这个特殊的“未找到记录”问题:
So, if you are not doing anything else other than this simple update back to CRM record, then complete the service.Update
in post-create plugin itself. 因此,如果除了这个简单的更新回到CRM记录之外你没有做任何其他事情,那么在post-create插件本身中完成
service.Update
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.