This code sample builds a Dynamics CRM custom workflow activity that generates summary data snapshots based on a FetchXML query and then stores them as records in the system. This is used to enable functionality similar to Salesforce.com's analytic snapshots. When this custom workflow activity is executed inside a workflow, the custom activity does the following:
For more information, please look at my A Data Snapshot Framework for Dynamics CRM blog post.
Visual Studio 2012/.Net 4.5 is required as is the Microsoft Dynamics CRM SDK. No other non-System assemblies are required. Additionally, you must sign the assembly to register it in the CRM sandbox, but I have not included my .snk file in this sample, so you will have to supply your own.
The sample download contains the TakeSnapshot.cs class required to build the custom workflow activity as part of the overall LucasWorkflowTools solution (this also contains the code used in my "Executing Dynamics CRM workflows based on a FetchXML query" sample) as well as the DataSnapshots CRM unmanaged solution export (DataSnapshots_1_0_0_0.zip). The solution export archive contains an already built assembly with the custom workflow activity ready for registration in your CRM system.