AddressMap and populating address fields

Hi,

Our SalesTable has two sets of address fields (Billing and Delivery). The Delivery fields were already set up with a Mapping under AddressMap.

  1. Is this what allows the City, County, and State to auto-populate when the Zip is entered?

I added a second mapping on the SalesTable to AddressMap for the Billing address fields, but it seems to have added a customization at the CUS layer instead of adding a second Mapping.

  1. Is there a way to create a Mapping for a second set of fields on one table?

Thanks!

Carolee

Hello Carolee, welcome to the Dynamics User Group.

I’ve moved your question because you asked in an already answered thread named “what is map in axapta?” and your question doesn’t seem to be the same.

Also please get used to always mentioning your version of AX - there are significant differences between versions. You can simply use tags for that purpose and when doing so, add more tags related to your question.

Regarding your questions:

  1. Yes, it’s one part of the solution. If I remember it correctly, there are methods on the map used by AddressZipCodeLookup form.
  2. I’m not sure what you mean by “it seems to have added a customization at the CUS layer instead of adding a second Mapping”. Adding a field mapping is a customization, isn’t it?
  3. I strongly suggest using the existing logic for alternative addresses instead of duplicating address fields on sales order. Invoice and delivery addresses are supported out of the box; no need to develop it once more.

Martin,

Thanks for getting me started.

  1. I didn’t state this very well. If I may try again… The original AddressMap has mappings for SalesTable. One of them is AddressMap.ZipCode == SalesTable.DeliveryZipCode.

I believe we need to add a third set of address fields (see #3 below) and I want to use the functionality that automatically populates other fields based on the zip code entered. To do this, I tried to add a second set of mappings for SalesTable for these new fields, one of them being AddressMap.ZipCode == SalesTable.BillingZipCode. Instead of allowing AddressMap.ZipCode to have TWO mappings, the changes I made to the CUS layer are overriding the original mapping.

So it seems that AX allows only one set of mappings per table. Is that correct?

  1. I learned a bit about alternate addresses since you suggested that functionality, but it doesn’t sound like they’ll work for a couple of reasons:
    a. We need to record a third address along with the usual invoice and delivery addresses.
    b. We do not need or want to retain this third address for re-use in the future.

We’re trying to support this scenario:

  • The end-user (our customer’s customer) places an order on Home Depot’s (our customer’s) website for an item which Home Depot does not stock
  • Home Depot places an order with us for the item
  • We ship the item directly to the end-user and invoice Home Depot
    • We include a packing slip in the shipment which indicates the end-user’s delivery address and bill-to address (this is the end-user’s billing info not Home Depot’s invoicing address). We have to receive the billing info from Home Depot only for the purpose of printing it on the pack slip.

I think this is justification for adding a third set of address fields, but would appreciate your input.

Thank you!

Carolee

I really don’t see any advantage in copying fields and logic to the order instead of just creating a record in the Address table. It would be unnecessary work and you see that it’s already causing you additional troubles.

I also don’t consider your arguments against Address table relevant.

The whole problem with mapping is completely avoidable - it wouldn’t exist if you followed rules of database normalizations. I’m not willing to spend my time with such an artificial problem. It’s also not clear how would AX decide which mapping to the same table should be used in a given moment and so on.