OutputParameters必须包含一个称为' BusinessentityCollection'的属性。类型Microsoft.xrm.sdk.EntityCollection SDK消息retievemultiple

发布于 2025-01-26 10:08:33 字数 810 浏览 2 评论 0原文

为虚拟实体创建插件时,试图在Microsoft.xrm.sdk中解析一个实体汇总到epellityCollection中,消息

错误

"message":"OutputParameters must contain a property called 'BusinessEntityCollection' of type Microsoft.Xrm.Sdk.EntityCollection for SDK message RetrieveMultiple",

代码失败了

            string data = await GetData(localcontext);
            
            var desrlzdData = JsonConvert.DeserializeObject<CustomEntity[]>(data);
            EntityCollection collection = new EntityCollection();
            foreach (var d in desrlzdData)
            {
                collection.Entities.Add(mapper(d));
            }

            // Add result to output parameters
            localcontext.PluginExecutionContext.OutputParameters["BusinessEntityCollection"] = collection;

Creating a plugin for virtual entity, while trying to parse an EntityCollection to PluginExecutionContext in Microsoft.Xrm.Sdk it fails with message

Error

"message":"OutputParameters must contain a property called 'BusinessEntityCollection' of type Microsoft.Xrm.Sdk.EntityCollection for SDK message RetrieveMultiple",

Code is something like

            string data = await GetData(localcontext);
            
            var desrlzdData = JsonConvert.DeserializeObject<CustomEntity[]>(data);
            EntityCollection collection = new EntityCollection();
            foreach (var d in desrlzdData)
            {
                collection.Entities.Add(mapper(d));
            }

            // Add result to output parameters
            localcontext.PluginExecutionContext.OutputParameters["BusinessEntityCollection"] = collection;

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

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

发布评论

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

评论(2

我是有多爱你 2025-02-02 10:08:34

修改最后一次:

localcontext.PluginExecutionContext.OutputParameters["EntityCollection"] = collection;

Modify the last time in this:

localcontext.PluginExecutionContext.OutputParameters["EntityCollection"] = collection;
不必在意 2025-02-02 10:08:34

问题在于异步代码,我在其中一个地方没有等待。因此,BusinessEntityCollection并没有被人口组成,但错误消息有点误导。

The problem was with async code, I was not doing await at one of the place. So The BusinessEntityCollection was not getting populated but the error message is bit misleading.

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