718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

Users of Microsoft Dynamics CRM 2011 have many features they can draw on to improve their CRM experience and improve business processes. One great feature to explore is using Fetch XML in a workflow.


Let’s dig in using a real business situation.

Scenario – How to determine if a Contract’s Contract Lines have a particular Product.

Solution – Luckily Microsoft CRM 2011 provides the use of executing Fetch XML in a custom workflow. Using Fetch XML (or Query Expression) in a custom workflow allows you to set up your query to use as many relationship levels as required. The added benefit of using Fetch XML is that you can use Advance Find to set up your query and download the Fetch Statement without using any other tools.

1. Start by using the Advance Find view to set up your fetch statement.

Microsoft Dynamics CRM Fetch XML

2. Next click on the Download Fetch XML button from the ribbon and open the downloaded file to select the fetch statement.

3. Next set up your Custom Workflow using Visual Studio 2010. For brevity you can reference http://msdn.microsoft.com/en-us/library/gg328515.aspx (Create a Custom Workflow Activity)

4. In the Execute method set a string variable with your Fetch XML statement and use the Services’ RetrieveMultiple method with a FetchExpression as its parameter.

Microsoft Dynamics CRM Workflows

5. Register your Custom Workflow using the Plugin Registration tool.

Now you have the ability to run your Custom Workflow and validate if a Contract has Product X.

Snazzy, eh? Let us know if this tip comes in handy or need a Microsoft CRM Partner to work assist in your project.

Happy CRM’ing.

Avatar for JoeCRM


Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.