Microsoft Dynamics 365 Blog

If you are importing addresses into AX you will discover that the zip codes in your addresses need to exist in AX before you can successfully import the addresses.  This is true regardless of the tool you are using to perform the imports.  If you are using AIF there isn’t an out-of-the-box service within AX form zip code imports.  The existing DirAddressService uses the Address table so it assumes that the zip code already exists.  There isn’t a service that uses the AddressZipCode table which is the one you need to import to.  That means you need to create a custom service.  Fortunately creating custom services especially this one is pretty easy.  The basic steps are:


1.      Create a query under the Query node that uses the table(s) you are interested in as datasources, in this case the AddressZipCode table is your datasource.

2.      Under Tools > Development Tools > AIF run the Create document service wizard choosing the query you created in step #1.  This will create the service for you.

3.      Change the namespace of the service.  (You don’t have to do this but I would recommend it in order to keep your services consistent with the out-of-the-box services.)  You do this in the AOT > Services > YourService – there’s a Namespace property on the service.  Set it to what the other services have for their Namespace property which is

4.      Assign a security key to the new service, again you do this in the AOT > Services > YourService.  You won’t be able to use the service until a security key is assigned so this is a required step.

5.      Enable the service in AX under Basic > Setup > AIF > Services.  If your service isn’t displayed when you come into the window, click the Refresh button.

6.    If you are using the web service adapter, in the Services form click the Generate button to generate the web service.

7.      Enable the service on your Endpoint.

8.      Run the service to start importing your zip codes.

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!