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”

Another form trick, copy-down in grids

A function I have often been asked for, but which does not exist in standard Dynamics AX 2012 is copy-down, or the ability to press a key on the keyboard to copy values into the currently selected field from the row immediately above it.  In my implementation, I have chosen the F11 key, as it was not used for anything else.

The function will be available on all grid-based forms, even in the table browser.

Continue reading “Another form trick, copy-down in grids”

Show environment bar in Dynamics AX forms

When working with multiple Dynamics AX environments, it’s quite useful to have a visual reminder of which environment you’re working in.

It is possible to use the instance name in the client configuration to provide this hint, but the instance name is not validated, nor does it indicate to the client which instance to connect to.  The connection is established only based on the host name, port name and WSDL port.  It is, in fact, possible to specify anything at all as the instance name:

My production server does NOT have an instance named MickeyMouse.  I promise…  Really…

Continue reading “Show environment bar in Dynamics AX forms”