Debugging .NET code called from Dynamics AX

From time to time it is necessary to develop custom .NET code and call it from Dynamics AX.  It could be that you already have the .NET code to do what you need and you don’t want to reimplement the functionality in X++, or what you are trying to do is too complex to do directly in X++.

One common situation is where you need to write a wrapper around some operating system functionality or web service to expose a much simpler API to AX.

This works, and AX has good support for calling .NET code through it’s .NET interop framework.  One thing that does become more complicated is debugging, but once you know how it is actually quite easy.

Continue reading “Debugging .NET code called from Dynamics AX”

How-to: Tree lookups in Dynamics AX reference group controls, part 4

This is something that keeps coming up on different projects, so I’d like to share how I usually do this.  There are some examples out there which try to describe a very generic solution which can be used in almost any case.  However, such solutions very quickly become very complex.  To keep things simple, I have tried to keep this example fairly specific but adaptable to a wide range of circumstances.  Specifically this example is using a fixed hierarchy structure with a fixed number of levels, each of which will be represented by a different table.

If you have not read the first 3 parts ( 1, 2, 3 ) of this tutorial yet, I recommend you do that first, to help with the understanding of this post, which explains how to automatically navigate to the currently selected item in the tree lookup.  This is something which is quite easy to do in a traditional lookup but requires a bit more work when dealing with trees.

Continue reading “How-to: Tree lookups in Dynamics AX reference group controls, part 4”

How-to: Tree lookups in Dynamics AX reference group controls, part 3

This is something that keeps coming up on different projects, so I’d like to share how I usually do this.  There are some examples out there which try to describe a very generic solution which can be used in almost any case.  However, such solutions very quickly become very complex.  To keep things simple, I have tried to keep this example fairly specific but adaptable to a wide range of circumstances.  Specifically this example is using a fixed hierarchy structure with a fixed number of levels, each of which will be represented by a different table.

Earlier, I have introduced the data model sitting behind the tree lookup, and last time I showed how to build the actual tree structure.

If you have not read these posts yet, I recommend you do that first, to help with the understanding of this post, which explains how to provide a more useful tree reference in the calling form.

Continue reading “How-to: Tree lookups in Dynamics AX reference group controls, part 3”

How-to: Tree lookups in Dynamics AX reference group controls, part 2

This is something that keeps coming up on different projects, so I’d like to share how I usually do this.  There are some examples out there which try to describe a very generic solution which can be used in almost any case.  However, such solutions very quickly become very complex.  To keep things simple, I have tried to keep this example fairly specific but adaptable to a wide range of circumstances.  Specifically this example is using a fixed hierarchy structure with a fixed number of levels, each of which will be represented by a different table.

Last time I introduced the data model that will sit behind the tree lookup.  This time I’ll show how to build the tree on demand to improve performance, and then how to build the actual tree lookup form.

Continue reading “How-to: Tree lookups in Dynamics AX reference group controls, part 2”

How-to: Tree lookups in Dynamics AX reference group controls, part 1

This is the first part of a multi-post series that explains how to do a tree lookup in a reference group control on an AX form.

It’s simple, just look at those trees up there…

Oh, seriously…

This is something that keeps coming up on different projects, so I’d like to share how I usually do this.  There are some examples out there which try to describe a very generic solution which can be used in almost any case.  However, such solutions very quickly become very complex.  To keep things simple, I have tried to keep this example fairly specific but adaptable to a wide range of circumstances.  Specifically this example is using a fixed hierarchy structure with a fixed number of levels, each of which will be represented by a different table.

I’ll show how to build the lookup, how to load the tree items on demand to speed up the loading times as well as how to properly select and return the selected record.  I’ll also show some suggestions for how to build the reference group properly so it is easy for the user to understand the information presented to him/her and to understand what to do.

This first part of the series shows how to set up the tables and their relationships.

Continue reading “How-to: Tree lookups in Dynamics AX reference group controls, part 1”