How to get country/Region code of the current company?


I am working in Ax 2009.

I have a current company code , please help me to get the country/Region code of the company.



You ask in a technical forum, which is for questions about installation and such things. Do you mean how to find it in GUI (therefore the question belongs to the user forum) or in code (and it belongs to the developer forum)?
By the way, I’ll add a tag with your version of AX, so it’s immediately visible at the usual place.

companyInfo.CountryRegionId (CompanyInfo::find().CountryRegionId )

Hi Kranthi,

Its not working…


Its a field on the table. If you fill it on the company information, then you will get it.

Basic → Setup → Company information

Hariyadav, “Its not working” is never a sufficient description of any problem. If Kranthi’s replies don’t help you, please provide a proper description of your problem.

I am getting error that The Table CompnayInfo does not contain this function

Please help

You mean this call, CompanyInfo::find().CountryRegionId
can you show us your code?

region =companyInfo.CountryRegionId (CompanyInfo::find().CountryRegionId );

I have created variable for companyInfo table as companyInfo.
and region is str.

region = CompanyInfo::find().CountryRegionId;

Thanks Kranthi

It Worked.

companyInfo.CountryRegionId (CompanyInfo::find().CountryRegionId );
The above line, i mean that you need to use that field and with in the brace i am saying how to get it.