Custom properties in monitoring and telemetry

Two years ago, I wrote a blog post Monitoring and telemetry in F&O where, among other things, I showed how to add a custom trace message and even include a custom property: Map properties = new Map(Types::String, Types::String); properties.add(’Feature’, ‘My feature 1’); properties.add(’MyCorrelationId’, ‘123456’);   SysGlobalTelemetry::logTraceWithCustomProperties(’Custom message from X++’, properties) Microsoft keep evolving this area …

Continue reading ‘Custom properties in monitoring and telemetry’ »

Filter for enum fields in OData service

It took me a while to figure out how to filter AX (Operations) enum fields in the URL for OData service (I was using Get records in Flow). For example, let’s say I wanted to get sales orders with status = open order. After a few failed attempts, I actually used classes generated by OData …

Continue reading ‘Filter for enum fields in OData service’ »

Operand types are not compatible

I managed to produce a really confusing error in AX 2012. Look at the following piece of code: MyExtendedDataType a, b; a = b; Pretty boring, isn’t it? There is nothing to fail… except that I got a compilation error: Operand types are not compatible with the operator. What? Actually it become quite clear as …

Continue reading ‘Operand types are not compatible’ »

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’ »