Nel Dynamics CRM 4 ci sono dei nuovi messaggi (New Plugin Messages made available by Microsoft in Dynamics CRM 4.0) per la gestione di particolare eventi :

Execute: The execute event always gets fired when you open the views. Like from Main application view, lookup view, Advanced search view etc. (but not from associated views).
While registering this event, no primary entity name is required.
Input parameter: fetchxml - The fetchXML query sent.
Output parameter: fetchxmlresult - The resultant records of the fetchXML query

Retrieve: The event is available for each of the entities like account, contact, custom entities etc. When user opens CRM record (CRM form) this event is fired
Input parameter: columnset - the attributes requested in the Retrieve Message
Output parameter: businessentity - The resultant business entity found.

Retrieve Multiple: The event will fire when user goes to associated view of Contacts or Custom entities that do not use the Rollup message. So it works for all associated views that does not provide the “Related Regarding Records” option.
Input parameter: query - Query passed to the Retrieve Multiple message
Output parameter: businessentitycollection - The resultset business entity collection.

Rollup message can be used for associated views that provide the option of displaying related records. However the Plugin registration tool does not provide for registering on the Rollup message. So that is something we still need to find out how it works.

Route: Route event gets fired when any of below entity instance moves from one queue to another.
Appointment, CampaignActivity, CampaignResponse, Email, Fax, Incident, Letter, PhoneCall, ServiceAppointment,
Task

In particolare il messaggio di Rollup è utile per intercettare l’esecuzione delle query fetchXml.
Anche se ufficialmente supportato è necessario abilitarlo sul sistema lanciando il seguente comando SQL [1]:

Update SdkMessageFilter 
Set IsCustomProcessingStepAllowed = 1 
Where SdkMessageId in 
(Select SdkMessageId From SdkMessage Where Name = 'Rollup')

 

 

[1] Handling Rollup message with plugins in Microsoft Dynamics CRM 4.0