Ben Walker
  • Blog
  • Blog

Can I get single quotes with my FetchXML, please?

13/10/2017

0 Comments

 
“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.
Picture
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…

Picture
Before formatting in FXB
Picture
After formatting in FXB
0 Comments



Leave a Reply.

    Archives

    July 2021
    June 2021
    May 2020
    March 2020
    December 2019
    October 2019
    June 2018
    February 2018
    October 2017
    September 2017
    August 2017
    May 2017
    April 2017

    Categories

    All
    Dynamics 365
    Dynamics CRM
    FakeXrmEasy
    LINQPad
    Testing

    RSS Feed

    Author

    Some stuff about me!

Proudly powered by Weebly