Catching exceptions in AX 7

In this blog post, I briefly recapitulate how to throw and catch exceptions in X++ and introduce a new way of handling CLR exceptions in AX 7. X++ exceptions When you want to throw an exception in X++, you typically do it by something like this: throw error("It’s broken!"); It’s a functional equivalent of adding a …

Continue reading ‘Catching exceptions in AX 7’ »

IoC containers for extensibility

Dynamics 365 for Operations (AX 7) tries to get rid of the ugly concept of “customizations”, when developers directly change somebody else’s code, which has a plenty of negative consequences. Most importantly, installing a new version isn’t easy, because it requires dealing with conflicts in code. There are several ways how to make a class …

Continue reading ‘IoC containers for extensibility’ »

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

OData service across companies

The OData service in Dynamics 365 for Operations returns data from user’s default company. But you can easily add cross-company=true to the URL (e.g. https://myaos.cloudax.dynamics.com/data/Customers?cross-company=true) to get data from all companies. You can also filter the query by DataAreaId field, if you want data from a specific company. But developers usually don’t construct the URL …

Continue reading ‘OData service across companies’ »

Generic types in X++ (AX 7)

This blog post assumes that you’re familiar with generic types. If it’s not the case, I suggest you look at my previous blog post before continuing. You can’t create generic types and methods in X++, so why would you care about generics at all? The main reason is that it’s used heavily in .NET codebase …

Continue reading ‘Generic types in X++ (AX 7)’ »