Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Enable Address Fields from RU Region Settings.

Posted on by Microsoft Employee

We have a new requirement in saving customer addresses. We need to save building number and apartment number along with the district of the customers. From what we found that these fields already exist however they are in Russian region settings. How to enable them?

Also what what we have understood that a change in address format will be required so that the format having building number will be displayed everywhere. Will this chnage in format show everywhere? Like all customer grid, invoices and reports?

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Enable Address Fields from RU Region Settings.

    Followed your recommendation and found formatAddress method on LogisticsPostalAddress and found some if conditions that were checking some settings for RU address  like the following :

    case LogisticsAddressElement::Building_RU:
         if (_building)//&& !LogisticsAddressFormatLines::includeElementInAddressFormat(addrFormat, LogisticsAddressElement::StreetName))
         {
             saveLogisticsAddress += _building + #Separators;
         }
    break;

    I commented the includeElementInFormat method as my requiremt is to include at all times. Same can be done for many other fields in the switch.

    Hope this helps anyone later on

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Enable Address Fields from RU Region Settings.

    I am afraid you need to read the code then, most likely it is in \Data dictionary\Maps\LogisticsPostalAddressMap\formatAddress, and similar methods, where they check country region ISO codes for Russia too. You'd have to read/debug the code to understand how it works, and change it according to your requirements to format it with building number etc.

    Please mark both answers as verified to resolve the thread.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Enable Address Fields from RU Region Settings.

    The unretrieved issue worked, however the format is still the old one.

  • Verified answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Enable Address Fields from RU Region Settings.

    Close the AX client, then delete the *.AUC files in your user profile (AppData\Local). It might be an incorrectly cached value from the AOT, let's see if it works afterwards.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Enable Address Fields from RU Region Settings.

    Hi Vilmos,

    Thanks for your reply. Its true I cannot change the region of my legal entity as its not in Russia.

    I Have added the two fields of Apartment and Building to the form. I went through the fields in their tables LogisticsPostalAddress the fields have no RU in CountryRegionCode. However the extended data type that they used had RU as a CountryRegionCode so I removed it.

    Now the problem is when I create a new customer and add all the fields, the address displayed in the customer details is still in the old format. Building number and apartment numbers are not shown. 

    Unret.PNG

    When I edit the address I have all the data I had inserted.

    Edit-Add.PNG

    I have also changed my organisation address format to show apartment and building.

    Format-Address.PNG

    I noticed something else too, I earlier had a column which used to show customer address in all customers grid. Now after this change its showing unretrieved.

    Unret.PNG

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Enable Address Fields from RU Region Settings.

    It will get enabled if you change your Legal entity address' country region to Russia.

    If you would like to use those fields without changing your country, then you have to remove the CountryRegionCode property on the table fields/form controls. It is also possible that it is tied to a Licese Configuration Key, which you could also remove.

    Also if there is connected business logic to those fields, then you need to check the code as well, since they might be doing country code validation around the code blocks too.

    Address format mapping is automatic, once you have access to the fields, you should be able to pull it in to your address format setup.

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans