Manipulating Addresses in Microsoft Dynamics AX 2012

Manipulating Addresses in Microsoft Dynamics AX 2012

Making the switch from Dynamics AX 2009 to 2012 can be a big change for users and developers alike. When making the switch, one of the big changes that affected what I was working on was how addresses are stored and handled in 2012. For example, in Dynamics AX 2009, if you wanted to store the address for the customer, you would add it on the main customer table (CustTable). In Dynamics AX 2012 however, this address is now stored on the LogisticsPostalAddress table and there are several relations that need to be made before you can grab the address. While the switch might seem drastic there are a few upsides. With the addresses being stored like this Dynamics AX can now keep track of historical changes to addresses. To do this, AX stores whichever address is valid and the effective date ranges for the previous iterations of the address.  There is also a view (DirPartyPostalAddresssView) in AX that displays all of the relevant address information for each customer. This keeps you from having to write long select statements each time you need to grab an address.

From a development standpoint, this changes the way we need to think about selecting the address. Instead of going to the main customer table to grab the address, we need to go to a view. Updating the address can also be tricky since you can’t update a view directly. Instead of using a direct update statement you will have to call the method createOrUpdatePostalAddress in order to update the address. You will also need to remember to pass in the correct validTimeStateUpdateMode so that AX tracks the address history properly. This may seem overwhelming and unnecessary at first but I think the changes will give developers more tools to help customize the addresses to meet their clients’ needs.

For more information, contact Blue Horseshoe, a Microsoft Dynamics Supply Chain ISV (http://bhsolutions.com/)

Share on Google+Tweet about this on TwitterShare on LinkedInShare on FacebookEmail this to someone