XML DocType in X++

Let’s say that we want to use X++ to create an XML file with the following DocType definition: <!DOCTYPE MyType SYSTEM "http://www.validome.org/check/test.dtd"> AX has Xml* classes (e.g. XmlDocument) for such purpose, but let’s build it with .NET classes first (you’ll see why in a moment). This is X++ code calling .NET classes through .NET Interop: …

Continue reading ‘XML DocType in X++’ »

Serialization of enum types

Situation: A web service hosted on Dynamics AX 2012 AOS; it finds some data in database on demand and returns them. The type of one of the fields is UtilElementType enum. Problem: If no record is found, system throws the exception “Enum value ‘0’ is invalid for type ‘Dynamics.Ax.Application.UtilElementType’ and cannot be serialized.” Analysis: Fortunately, …

Continue reading ‘Serialization of enum types’ »

Serializace výčtových typů

Situace: Webová služba hostovaná na AOS Dynamics AX 2012, na požádání najde určitá data v databázi a vrátí je. Typ jednoho z polí je výčtový typ UtilElementType. Problém: Není-li nalezen žádný záznam, systém vyhodí výjimku “Enum value ‘0’ is invalid for type ‘Dynamics.Ax.Application.UtilElementType’ and cannot be serialized.” (“Hodnota ‘0’ není platná pro výčtový typ ‘Dynamics.Ax.Application.UtilElementType’ …

Continue reading ‘Serializace výčtových typů’ »