Thursday, November 25, 2010

Update changes to Production/live environment

Most companies have 3 different Dynamics AX environments:

- Development environment
- Test/Acceptation environment
- Production/live environment.

When a customer wants to have changes to their production/live environment, the describe some kind of document with requirements. A developer will implement the requirements in their Development environment. When he is finished someone has to copy the changes to the test/acceptation environment. The customer will test the changes and when he accepts them, the changes have to be copied to the production environment.

This coping of changed code can be done in 2 ways:

- Xpo file (with label files).
- A var layer files (with label files).

  1. Copy the delivered Xpo or layer and label files to your delivery archive directory. (Note use the delivery date in the folder name). 
  2. Create in the archive directory a directory backup.
  3. Stop all batch servers.
  4. Stop all AOS. 
  5. Remove all cache files (del/s *.aoc). 
  6. Create a database backup and copy this to the archive backup directory.(point 2)
  7. Copy the axVar.aod, axCus.aod and axUsr.aod from your test environment to the archive backup directory and to the “old” directory in your application tree. (So you can do layer compare afterwards).
  8. Copy the label files into your application tree.
  9. Start an AOS with a different name and/or Port number. This new AOS should only be used for administration purpose. The reason for this dedicated AOS is that upgrading AX can conflict to the stability of your environment. The end user can experience the next thing: a.
  10. a. Stack traces on the screen.
    b. Missing labels.
    c. Lost or corrupted data.
    d. An occupied phone line of the Dynamics AX administrator, because  everyone is phoning him that he or she can’t do her work.
  11. Import the Xpo file and press the recompile button if errors occur. If the error a stays repeat this step one more time. 
  12. Administrator/Periodic/SQL Administrator use check/synchronize to update the data model. Run it a second time in diagnostic mode only, to be sure it was ok.
  13. Administrator/Periodic/Compile application. (Compiling from the AOT will not work when no developers license is used)
  14. Stop the administration AOS.
  15. Start live/production AOS.
  16. Start all Axapta batch servers.

Wednesday, November 24, 2010

Using while select firstonly to avoid validations in Dynamics Ax

When you execute a select statement to retrieve a single record most of us right the query first. This is followed by a validation to ensure that the query has returned a record. we make it simpler If we right it the way mentioned below

static void WhileSelectInsteadoFSelect(Args _args)
    CustTable custTable;

    //-----General way---------
    // fetch the record first
    select firstonly forupdate custTable;

    //add an additional validation
    if (custTable.RecId)
         custTable.Memo = 'updated value';

    //prevents the extra 'if' check
    while select firstonly forupdate custTable
        custTable.Memo = 'updated value';

    //can also be used for simple readonly
    while select firstonly custTable

Sunday, November 21, 2010

Intelligent Data Management Framework For Microsoft Dynamics AX

From the IDMF page.:

"The Intelligent Data Management Framework for Microsoft Dynamics® AX helps administrators optimize Dynamics AX database layout by providing functionality to manage key database layout techniques, by way of intuitive Archiving and Purging capabilities.

The framework provides the platform for reduction in database size by purging and archiving of transactions records from sets of relating entities, while maintaining the consistency and integrity of production data. The Intelligent Data Management Framework provides customers and partners the ability to identify and discover related entities based on the Microsoft Dynamics AX metadata and to determine the purging or archiving criteria for tables.

The Intelligent Data Management Framework also analyzes the Production database to determine usage patterns and assesses the health of the Microsoft Dynamics AX Application. This Framework is compatible with all supported versions of Dynamics AX. The Intelligent Datat Management Framework for Microsoft Dynamics AX is a benefit of staying enrolled in a Business Ready Enhancement plan."

The following is a direct link to a presentation put on by Tao Wang Principal Development Manager Dynamics AX performance, at the AXUG Summit this year: TEC01 - The New Intelligence Data Management (IDM) Tool