OutputParameters必须包含一个称为' BusinessentityCollection'的属性。类型Microsoft.xrm.sdk.EntityCollection SDK消息retievemultiple
为虚拟实体创建插件时,试图在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改最后一次:
Modify the last time in this:
问题在于异步代码,我在其中一个地方没有等待。因此,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.