Dynamics CRM 2011 Plugin Retrieve and Retrieve Multiple

寵の児 提交于 2021-02-07 20:30:56

问题


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. 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. 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.

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).

Further related to the above posting is one from Chaitany

In this example he is implementing a similar solution as a post-operation and grabbing the property "BusinessEntity" from the context output parameters. (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.

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.


回答1:


For 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.UpdateObject(phoneNumber);


来源:https://stackoverflow.com/questions/15048688/dynamics-crm-2011-plugin-retrieve-and-retrieve-multiple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!