Transform XML Entity Export using XSLT

Data Management in Dynamics 365 Finance and Supply Chain Management can be used to export Entities in different formats like XML. In many cases the default Entity schema is not what you want. However, you can easily transform the XML output by applying an XSLT transformation directly in Dynamics.

I’ve made a short video how to transform the EcoResReleasedProductsV2 XML entity export into another schema with different structure and element names.

AX 4.0 Send GUID in AIF document

I’ve noticed a a bug in AX 4.0 (K/A: 4.0.2501.116) AIF implementation when using a table field type GUID. Unfortunately the generated XSD schema referred to the field type as Int64 instead of GUID. The sent XML of course contained an GUID String {00000000-1234-5678-9101-000000000000}. My C# .NET client reported an error because the received value was not a valid Int64.
I solved the problem by editing AxdBaseGenerateXSD.addGuid() method
protected void addGuid(
SysDictType dt,
XmlSchemaSimpleTypeRestriction restriction
)
{;
/*  restriction.baseTypeName(
XmlQualifiedName::construct(
this.addInt64Type(),
targetNameSpace)); */
restriction.baseTypeName (XmlQualifiedName::construct(
this.addGuidType(),
targetNameSpace));
}
As result the generated XSD schema contained the correct GUID definition
<xs:simpleType name=”AxdExtType_MyGUID“>
<xs:annotation>
<xs:documentation xml:lang=”DE-AT“>A Guid field</xs:documentation>
</xs:annotation>
<xs:restriction base=”AxdType_GUID” />
</xs:simpleType>

<xs:simpleType name=”AxdType_GUID“>
<xs:restriction base=”xs:string“>
<xs:minLength value=”38” />
<xs:maxLength value=”38” />
<xs:pattern
value=”({[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}})” />
</xs:restriction>
</xs:simpleType>