Can I get single quotes with my FetchXML, please?

“I’d like my FetchXML with double quotes, please”, said no Dynamics developer, ever.

If you ever export FetchXML from the Advanced Find tool in Dynamics, you’re most likely doing this because you want to use that FetchXML in code somewhere. Isn’t it annoying, therefore, that FetchXML exported from the tool uses double-quotes to denote XML attribute values, when the first thing you will have to do every time is to change the double quotes to single quotes before you can use the FetchXML in your .Net code?

I don’t have a solution for that issue, per se, but many developers may not be aware that the FetchXML Builder tool in the XRM Toolbox has an option to render all FetchXML using single quotes.

This means not only that FetchXML rendered from the Fetch XML Builder (FXB) tool itself can be rendered in a more developer-friendly way, but also that any of the other plugins in the toolbox that use the FXB, such as the View Designer, can similarly be used to produce nicely formatted single-quoted XML.

You can even paste FetchXML exported from CRM into the builder, close and open it again and it will have replaced all double with single quotes…

Before formatting in FXB

After Formatting in FXB

Posted in Dynamics CRM, Uncategorized | Tagged | Leave a comment

Leave a Reply