James Downey’s CRM Blog
Thoughts on the technology and business of CRM

CRM 4.0 Version of FetchXML Builder Released (Finally)

Monday, 10 November 2008 14:50 by James Downey

I have finally updated FetchXML Builder with a few new features including IFD authentication support and the ability to auto-generate code for using QueryExpression.

This version was built against the CRM 4.0 web services but I have kept the CRM 3.0 version on the site for those organizations that have not yet upgraded.

FetchXML Builder is an interactive query builder for constructing and testing FetchXML statements. FetchXML is an XML-based query language for retrieving data through the Dynamics CRM web services.

Although FetchXML is not as powerful as SQL, it has certain advantages when used in CRM development. Unlike the QueryExpression class, FetchXML can be used to retrieve attributes from multiple entities. And unlike filtered views, FetchXML makes use of the CRM web services and does not require passing end user credentials to the SQL Server, which in some scenarios requires the configuration of Kerberos.

As a rule of thumb, I'd recommend using the QueryExpression class if you do not need to retrieve attributes from more than one entity. It is faster than FetchXML and it also uses the web services. If QueryExpression will not work, then go with FetchXML. If the query is too complex to form with FetchXML, you will need write a SQL statement to call the filtered views, which are database views in SQL Server that filter results based on the user's identity.

FetchXML Builder is a useful tool regardless of whether you will use QueryExpression, FetchXML or filtered views. Use the controls on the form to formulate a query. Click the Create FetchXML button to generate a FetchXML statement. Click Run Query to test it. Click on Create Code to copy either C# or VB.Net QueryExpression code to the clipboard. If you need to write a SQL statement, use the tool to discover the relationships between entities and the schema names, which will be helpful in writing the SQL.

Download FetchXML Builder

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   FetchXML | Technical
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed