web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Removing country region specific code from classes

(0) ShareShare
ReportReport
Posted on by 2,734

Hi All,

I have a test environment of AX 2012 R2 which has code in it relating to country region areas that I want removed - is there any way to remove certain country region data and then recompile the application to remove this code?

*This post is locked for comments

I have the same question (0)
  • Kauto Profile Picture
    2,734 on at

    For example removing all code throughout the system with certain tags like // IND or CZ

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    of course its possible by any two ways

    1. Remove existing CountryRegionId from current object.
    2. Don't do #1, just add your own country also.

    Note: I am not sure about its legality, W.R.T Microsoft Licensing Terms.

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    removing with tags may not be 100% correct. as starting and ending tags may not bring 100% correct result.

    Better would be use Ctrl+F and update code manually.

    You cam also write job to know which objects belong to a specific country region

  • Kauto Profile Picture
    2,734 on at

    Hi Sohaib,

    I don't really want to do that as I shouldn't have to - if I only select region UK English - why do I have code throughout the system for other countries and functionality I don't need - for example in ProjInvoiceDP - I have  

    // <GEECZ>

       countryRegion_CZ        = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoCZ]);

       transOriginalInvoice_CZ = new Map(Types::Int64, Types::String);

       // </GEECZ>

    I want to change something in the license setup or config somewhere - recompile and it removes all references to code relating to <GEECZ> for example

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    Go to license configuration and turn off CountrySpecific Functionality, which country you want or not

    In system there is If condition for Countries in code, so you don't need any extra work. Simply code related to that country will not execute. Even, fields and everything related to that country will be non-visible

    Do you have any specific requirement, which are restricting you disabling Key, do share with us such restriction

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    Additionally, at many places in codes system reads country which is associated with your company/legal entity, which you provide at time of company creation.

    Suppose you provided UK as country code, and created legal entity.

    Now system will only execute code reacted to UK (Country provided in company/legal entity)

  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Kauto,

    Note that Microsoft Dynamics is not a local UK product, but a product with many localizations and translations.

    The system caters for regulations of many countries. These code is in the base application as it is needed for some countries. If you are e.g. a manufacturing company, would you also ask why there is code in the system related to retail functionality?

    The localization coding should not impact your business. Sohaib already mentioned that only the base coding and localized coding for e.g. your country will be executed.

  • Kauto Profile Picture
    2,734 on at

    Thanks Andre, yes I fully understand the localisation issue and respect that, but I have upgraded from AX4 and in my production environment the code doesn't include some regional code sections and in my test environment they are present - I had thought certain regional coding snippets could be switched off through regional licensing or configuration.

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

     "in my production environment the code doesn't include some regional code sections and in my test environment they are present"

     

    Are you sure that Kernel and Application version are same on your TEST and Production environment ?

    Have you verified that?

  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    In addition to Sohaib: You can compare the application version, but also check if possible customizations overlayered some objects and therefor some code is missing.

    The scope of your question is different now compared to the original. If you mentioned that there are differences between production and test, we would have provided completely different answers.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans