Monday, November 7, 2011

Get the active comapny in AX 2009 - curExt()

Use the curExt() function to get the active company in AX;

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = curExt();
Info(CompanyId);
}

You would also use the following with the same results. However, the above is much more elegant.

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = CompanyInfo::Find().DataAreaId;
Info(CompanyId);
}

Take Care!

2 comments:

Thank you for your thoughts. Your comment will appear in my blog shortly after review.

Have a great day!