Friday, August 24, 2018

AX - How get active country code

This country code is readed from legal entity. The example shows how to work with macro. #isoCZ is in #ISOCountryRegionCodes macro defined as "CZ".
#ISOCountryRegionCodes
static void Job(Args _args)
{
  LogisticsAddressCountryRegionISOCode isoCode = SysCountryRegionCode::countryInfo();
    
  if (isoCode == #isoCZ ) info( isoCode );
}
Output:
CZ
Note: To defined macro you can pass parameters. In macro you access to its by order -> %1, %2 ...and so on.

No comments:

Post a Comment