April 01, 2013

Get Current Company in AX

Get Current Company in AX

Below is the example on how to get current company in AX 2009.
In AOT > Jobs, paste the following code:


static void curExtExample(Args _arg)
{
    str curCompany;
    ;
    // Sets curCompany to the extension of the current company.
    curCompany= curExt();
    print "Current extension is " + curCompany;
    pause;
}

You can use this code in your forms and reports also to parameterized your reports/Forms.

-Harry

1 comment:

Thanks