Database upgrade in AX 6.0 or Dynamics Ax 2012

I came across nice blog on database upgrade in new version AX6.0 and other cool features , please don't miss this ,

http://blogs.msdn.com/b/mfp/archive/2011/01/21/getting-to-ax-2012.aspx

My main motive to share stuff about AX 6.0 is to make our self update with skills that will be going to use in new version when it hits market!!!

X++ CODE TO READ MS OFFICE WORD DOCUMENT

Use the below job if you want to read text from MS Word document in Dynamics Ax 2009.

static void FileIO_ReadFromWord(Args _args)
{     
        str         document = "D:\\Demo Edition.doc";
    COM         wordApplication;
    COM         wordDocuments;
    COM         wordDoc;
    COM         range;
    TextBuffer  txt = new TextBuffer();
    ;

    // Create instance of Word application
    wordApplication = new COM("Word.Application");

    // Get documents property
    wordDocuments = wordApplication.Documents();

    // Add document that you want to read
    wordDoc = wordDocuments.add(document);
    range = wordDoc.range();

    txt.setText(range.text());

    // to replace carriage return with newline char
    txt.replace('\r', '\n');   
   
    info(txt.getText());
}

Integrate Google Map in Dynamics AX 2009

If you want to have feature for locating the customer/vendor addresses on Google map , than please have a look below ,

On Address form i have added a button Google Map , if clicked it will open Google Map inside AX!

For Having fun , select any record and change the address information and click on Google Map







Enjoy Learning AX !!!!

HOW TO USE STR VARIABLES IN SQL WHERE EXPRESSION, DAX 2009

I think most of us faced this issue , when we try to use str variable in X++ SQL statement like below

"Error: Container and unbounded string (text) fields are not allowed in a WHERE expression."


 
Because when trying to use unbounded string variable within a select / where expression , it is expecting a limited sized string , so the solution is to limit the size of variable as below
 






Eventhough we are using string EDT's we won't get this error , because each string EDT will have its size.

X++ CODE TO GENERATE ALERT FOR RECORD IN DAX 2011

EventInbox and EventInboxData are two tables which will store the data related to alerts.
So one can easily generate alert by creating a record in EventInbox for xx user.
The problem with above approach is that alert will be triggered but if the user want to see for which record alert is triggered (by clicking on Go to Origin) than it will fail.

Always remember to make use of helper class  in DAX 2011 , whenever you want to use existing feature / functionality from standard product.

Following job illustrates how to use helper class EventNotification to generate alert  for InventTable record !

static void Event_sendAlertByCode(Args _args)
{

    EventNotificationSource _source;
    EventNotification       event = EventNotification::construct(EventNotificationSource::Sync);
    InventTable             inventTable;
    ;

    inventTable = InventTable::find('B-R14');  // sample record for which alert is shown

    event.parmRecord(inventTable);
    event.parmUserId(curuserid());      // user for which this alert to be shown
    event.parmDataSourceName('InventTable');  //form datasource
    event.parmMenuFunction(new MenuFunction('InventTable', MenuItemtype::Display));
    event.parmSubject('Test');
    event.parmMessage('Test Event alert');
    event.create();

}

When you run the above job , you can see alert for that user


Select the alert created above and click on Go to origin, then u will find record as,






By making use of helper class hardly we wrote 10 lines of code to accomplish the alert feature and thereby ensuring the quality of code, so always check twice for existing helper class before writing your own!!!!

Whats New in DYNAMICS AX 2012 OR AX 6.0 NEW COOL FEATURES

Wish you happy new year to you all and may you find always happiness in your life  :)

As you all know this year (2011) Microsoft is planning to release Dynamics Ax 2012 or famously called as Ax 6.0 .   So what we can expect in this new version , have a look below

1. Shift away from AOD files to a SQL Server-based model store, model files (.axmodel), the perception of "parallel layers" using models, the command-line utility AXutil to manage manage models and model files as well as the graphical Model Management tool for managing models and model files.

2. Setting up security in Microsoft Dynamics AX using the new role-based security model. wherein you will define the security artifacts in the AOT and creating security policies.

3. In Current version DAX 5.0 Configuration of Microsoft Dynamics AX2009 Role Centers and analysis cubes required a BI developer. In AX 6.0, setup and configuration of Analysis cubes can be done by a customer/partner with a wizard driven interface without having to go into BI development studio. 

4. New eventing feature will be available in Microsoft Dynamics AX,  it can be used to decouple publishers and subscribers, alleviating many upgrade issues.

5. Element IDs (such as table and class IDs) have been a problem since Microsoft Dynamics AX1 because they are limited to small ranges and often results in conflict between solutions. This, however, is changed in Microsoft Dynamics AX6. 

6. A lot of Workflow enhancements has been done in Ax 6.0 , wherein user will configure the workflow the way one creates flowchart in Visio.

7. Layout guidelines to support which language(X++ or .Net) or development environment (Visual studio or Morphx) to choose while doing customizations or developments.  So guys/gals please make yourself updated with C# development.

8. Tool available to Convert Reports developed in X++ to SSRS Report !!! And also the way used to deploy the SSRS Reports has been changed.

9. New enhanced X++ editor with lots of colored indentation , intellisense features and code formatting!!

10.  New Reporting programming model based on RDP which provides more controll over data and UI design.


Prepare yourself  to upgrade/development battle and enjoy new version once it reaches market !!!!