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

June 22, 2015

Restore the DB, showing DB in use

Hi Folks,

Recently I was facing some issue while restoring AX database, whenever I try to restore the Transactional DB its show error "DB is use" while actually this DB is not used anywhere. Than I try to take take the database offline, But again there was one other issue.
Same issue again DB offline taking very long time.
I tried below steps and this worked for me. :)
Step 1: Try to run below two queries in same given sequence.
i. ALTER DATABASE <DBNAME> SET OFFLINE WITH ROLLBACK IMMEDIATE
ii. ALTER DATABASE <DBNAME> SET Offline
Step 2: Now try to take offline manually.
clip_image001
Step 3: Restore the DB.
Step 4: Some time after doing restoration/backup DB will not work.
Than u need to roll back above query operation
ALTER DATABASE <DBNAME> SET online WITH ROLLBACK IMMEDIATE
ALTER DATABASE <DBNAME> SET online.
Related Post:
AX DB restoration: Database goes into “Restoring” state for long
-Harry

June 14, 2015

Dynamics AX 2012 R3, CU9 is out in market.

Hi Folks,

Finally CU9 is released this week.
Here is some more details about this Cumulative update.

New Highlights

1. Introduced new features into HR, Transportation Management,Warehouse Management and Retails modules.
2. Many county-specific regions updates including US, UK, INDIA, Poland, Belgium, Brazil, Europe, Germany, India, Italy, Lithuania, Mexico, Netherlands, Russia, Spain, Austria and Poland

General Information
1. Installation Guide
2. What’s new in CU9
3. Build No: 6.3.2000.326
    Kernel: 6.3.2000.326

Download Option:
1. From LCS
2. From Partner/Customer resource

- Harry