Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Address formats different for countries other than current company

Posted on by Microsoft Employee

I've been presented a requirement where the client only wants printed addresses to include the country/region ID if said country/region ID is different from the country/region ID of the primary address for the current legal entity in which the current user is working.  This feels like a sufficiently 'obvious' request that I'm hoping it may be covered somewhere in standard AX, but I can't see anything in the Organisation administration > Setup > AddressesAddress setup or Organisation administration > Setup > Global address bookGlobal address book parameters forms that might fit the bill.

My first thought was to modify the LogisticsPostalAddress::formatAddress method to implement this as a customisation, but given that addresses aren't specific to a company/DataArea, that simply doesn't make sense.  Additionally, it makes me more certain that this probably isn't a standard piece of functionality.  Hence, can anyone think of a smarter way to do this than adding a new public static method to the LogisticsPostalAddress table (i.e. formatAddressForInternationalMail) that's pretty similar to formatAddress, but conditionally includes the country/region ID?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Address formats different for countries other than current company

    Thanks André.  Creating a new column in the table for [DomesticAddress] and leaving the existing [Address] column as is will probably be how I approach this.  That way, the LogisticsAddressFormatProcess::run method will still work with the address formats as configured in standard functionality: I'll just have to customise the class to populate the [DomesticAddress] as per [Address], with the exclusion of Country/RegionID.  Whilst this will require a check every time the print address is requested, a helper method for that to compare the address country to the current company country should make everything relatively neat in terms of abstraction.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,228 Super User 2024 Season 2 on at
    RE: Address formats different for countries other than current company

    Hi Rich,

    You can try to create a runtime function to remove the Country part or do new format of the complete address in case the address is within the same country as the current legal entity. Before going into this you need to be aware that this will have a minor performance penalty. When it comes to large number of addresses that needs to be used in some process, another approach like creating a new combined address field for internal country might be quicker. But also here a statement is required to determine if the standard address field or the new field must be used.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans