Источник:
http://mscrmblog.net/2015/01/15/mani...crm-2013-grid/
==============
Using a CRM plugin you can manipulate the data returned by CRM before the data is returned to the user in the grid/sub-grid.
Some examples would be:
- Deny the user access to specific data in a specific field based on a security role
- Get data from a lookup record on a related entity and display it dynamically on the grid.
Create your new plugin class and register it on the RetrieveMultiple message, select your entity and keep the stage of execution as Post operation
Get your entity collection:
var results = (EntityCollection) context.OutputParameters["BusinessEntityCollection"];
You can run your own queries and add your own logic, then to set the column value for the grid use:
entity.Attributes["ecs_emergencycontactphone"] = contact.GetAttributeValue("mobilephone");You will need to have a ‘dummy’ field on your entity to be used to display the data however this field will always be empty.
The field will also need to exist in the view or in the columnset retrieval.
This does
not update the value in the database rather just a dynamic way of displaying data from another entity.
Источник:
http://mscrmblog.net/2015/01/15/mani...crm-2013-grid/