September 13, 2015

How to Export/Import Label files in AX 2012

Label are pretty different in AX2012 instead of earlier version of AX. Here is quick steps to import and export Label files from one Environment to other. You also perform an update on label files.
Export a Label file:
Open AOT, Expend Label node. Choose Label and require language to export. You can do it for individual language or you can select multiple language all in once.
image
Exported file will save on selected path with extension “.ald”.
Import Label File:
Right click on Label node in AOT and select “Create from File”, choose ald file to import than hit create.
image

image

Update a Label file:
Import the new updated label file system will ask to overwrite , go ahead
image
It will update your existing Label file.
Note: You must run full Synch after every import/Update.
More info: https://technet.microsoft.com/en-us/library/gg731886.aspx
-Harry

August 26, 2015

Date manipulation through X++ code [AX 2012]

Hi Folks,

I come though a requirement where I need to manipulate on “FromDate” and “ToDate”. When user enter these value through a dialog box, user can select any day from month for eg.

From Date: June 6, 2015
To Date: August 20, 2015

image

And to perform some action on Financial stuff we may need to consider the whole month like
from June 1, 2015 to August 31, 2015

You can fetch this month range in your x++ code, here is a sample code, try it…
static void theAxapta_MonthRange(Args _args)
{
    DialogField                     dialogStartDate, dialogEndDate;
    Dialog                          dialog = new Dialog("Month range");
    TransDate                       fromDate, todate;

    dialogStartDate = dialog.addField(extendedTypeStr(TransDate));
    dialogEndDate   = dialog.addField(extendedTypeStr(TransDate));
   
    dialogStartDate.label("From Date");
    dialogEndDate.label("To Date");
   
    if(dialog.run())
    {
        fromDate = mkDate(1, mthOfYr(dialogStartDate.value()), year(dialogStartDate.value()));
        toDate   = (mkDate(1, (mthOfYr(dialogEndDate.value()) + 1), year(dialogEndDate.value())) - 1);
       
       
        info(strFmt("Start Month %1", fromDate));
        info(strFmt("End Month %1", todate));
    }
}


Output:

image

In case of any suggestion and query, feel free to drop as a comment.

-Harry