简体   繁体   English

Dynamics CRM 2011插件检索和检索多个

[英]Dynamics CRM 2011 Plugin Retrieve and Retrieve Multiple

I'm looking for some working examples of retrieve message and retrieve multiple message plugin (Early binding). 我正在寻找一些检索消息的工作示例并检索多个消息插件(早期绑定)。 I've failed to find any successfully examples looking on line. 我没有找到任何成功的例子在线查找。 I've checked the SDK, and various forums. 我已经检查了SDK和各种论坛。 Links or working examples would be greatly appreciated! 链接或工作示例将不胜感激!

What I'm trying to accomplish is the intercept and update of specific fields before presentation on the UI. 我想要完成的是在UI上呈现之前截取和更新特定字段。 I'm able to partially accomplish this via javascript which is the preferred method, but unfortunately the presentation in grids etc.. cannot be handled in this manner. 我能够通过javascript部分完成这个,这是首选的方法,但遗憾的是网格等中的演示文稿无法以这种方式处理。

I found a link online 我在网上找到了一个链接

In this example he's able to intercept the message and update the value, but this appears to only have worked in roll-up 6 (I'm on 10). 在这个例子中,他能够拦截消息并更新值,但这似乎只适用于汇总6(我在10)。

Further related to the above posting is one from Chaitany 与上述帖子有关的还有一个来自Chaitany

In this example he is implementing a similar solution as a post-operation and grabbing the property "BusinessEntity" from the context output parameters. 在这个例子中,他正在实现一个类似的解决方案作为后期操作,并从上下文输出参数中获取属性“BusinessEntity”。 (This is confusing to me because I don't see this property defined in the Retrieve Reponse I assume this should be a property of the RetrieveResponse. (这让我感到困惑,因为我没有看到在Retrieve Reponse中定义的这个属性我认为这应该是RetrieveResponse的一个属性。

Ultimately, I'd like a solution where intercept the retrieve or retrieve multiple,adjust the values for presentation and then revert back if the form is saved. 最终,我想要一个拦截检索或检索多个的解决方案,调整显示的值,然后在保存表单时恢复。

For retrieveMultiple: 对于retrieveMultiple:

EntityCollection entities = (EntityCollection)context.OutputParameters["BusinessEntityCollection"];

For retrieve: 用于检索:

Entity entity = (Entity)context.OutputParameters["BusinessEntity"];

The cool thing about retrieve multiple is that any adjustments that you make in retrieve will be applied for retrieve multiple. 关于检索多项的一件很酷的事情是,您在检索中进行的任何调整都将应用于检索多个。

After adjustments have been made then it's just a matter of issuing the following: 经过调整后,只需发出以下内容:

  • xrm.Attach(phoneNumber); xrm.Attach(phoneNumber的);
  • xrm.UpdateObject(phoneNumber); xrm.UpdateObject(phoneNumber的);

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM