Here are links to a variety of code samples, CRM utilities I've written and my public GitHub repositories.
Dynamics CRM utilities
MSDN code gallery samples
- Posting/processing JSON in a CRM 2011 custom workflow activity - With the proliferation of RESTful APIs, JSON is frequently used as a message format for interoperability. This sample shows how to POST JSON messages to a REST endpoint and process the response in a Dynamics CRM custom workflow activity.
- Scheduling recurring Dynamics CRM workflows with FetchXML - This code sample builds a Dynamics CRM custom workflow activity that takes a FetchXML query and a workflow (lookup) object as input parameters, and then it executes that workflow for each record returned by the query. I use this to schedule recurring workflows in CRM.
- Simple C# class to populate datatable from FetchXML - If you want to populate a datatable object with results retrieved from a FetchXML query, there are several differences in how the results are returned compared with a typical SQL query. In this sample I show an easy way to address some of the more annoying ones.
- Taking Scheduled Data Snapshots in Dynamics CRM - 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.
- Unit testing Dynamics CRM C# interfaces code using NUnit and Moq - This sample contains the solution I used for my three-part blog series on unit testing C# interfaces with Dynamics CRM 2011 using NUnit and Moq. Each of the tests in this sample demonstrates a progressively more complex test scenario.