D365 Portals – application/xml

I keep forgetting how to do this and can’t remember where I saw it written down so I am writing this down now. If you need to check the fetchXML that is being called as part of a Web Template then you can return that fetchXML in a Web Page. This can be useful where you have fetchXML that is generated dynamically based on request parameters or if you just want to check the values that are included in your fetchXML from the request.params collection.

  1. Create the Web Template with your fetchXML query
  2. After the {% endfetchxml %} line, display the content of you fetchXML query using the XML property of your fetchXML object.
  3. Set the MIME Type of the Web Template to application/json
  4. Create a Page Template for your Web Template, with no headers or footers.
  5. Create a Page using the Page Template so you can get the XML content

For example, my Web Template would look like this

{% fetchxml assetQuery %}
<fetch version='1.0' output-format='xml-platform' mapping='logical' page='1' count='200'>
  <entity name='msdyn_customerasset' >
    <attribute name='msdyn_customerassetid' />
    <attribute name='msdyn_account' />
    <attribute name='msdyn_parentasset' />
    <attribute name='msdyn_name' />
        ...
           ...
              ...
  </entity>
</fetch>
{% endfetchxml %}

{{ assetQuery.xml }}

XrmToolbox – Portal Records Mover – Folder Structures

Version 1.2019.10.9 of the Portal Records Mover tool in the XrmToolbox has introduced an excellent new feature – the ability to export the content as a folder structure and with the option to ZIP up the content.

Portal Records Mover

Previously, the configuration would be exported into a single XML file which made it difficult to identify what items were included in your export once you closed down XrmToolbox and filed away your configuration in source control. With the new version if you elect to Export as folder structure then not only do your exports get separated into different folders but the configuration records are created as separate files. The filename is the GUID of the configuration record.

Portal Records Mover

Portal Records Mover

The other advantage this creates is that you can now be more selective on the configuration you want to import into your target environment. The source file for your import can now be the entire root folder, individual folders or individual file (ZIP or XML).

Portal Records Mover