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

July 04, 2015

AX7 aka Rainier , The most awaited version of Dynamics AX

Hi Folks,
Very soon we all are going to meet with AX7, by the end of this year it must be out in market. Initially this is going to be cloud only, with Azure you need LCS account to deploy this on cloud. In this version MS going to introduce many major/minor changes in their product like
- Initially there is on premises deployment, only cloud is the only option.  
- Development will happen in Visual studio only. (I guess we need the ultimate version only)
- New AOT design
- Totally web based UI, no rich client.
- No more life for Enterprise portal.
I will keep you posted about the updates on AX7.
Thanks-
Harry

-Harry Follow us on Facebook to keep in rhythm with us. @Facebook https://www.facebook.com/theaxapta