Programming4us
         
 
 
Applications Server

Microsoft Dynamics AX 2009 : Working with Forms - Modifying application version

2/16/2012 3:17:29 PM
Dynamics AX identifies its releases with two version numbers— kernel version and application version. For example, version number 5.0.593.0 means Dynamics AX 2009 RTM and 5.0.1000.52 is Dynamics AX 2009 Service Pack 1. Dynamics AX hotfix rollups are presented in a similar way by only updating the last version number digits. Version numbers an be viewed in the About Microsoft Dynamics AX dialog, which can be accessed from the Help menu.

Besides standard versioning, Dynamics AX allows adding additional versions for solution developers to control their releases. In this recipe, we will learn how to do that. We will modify standard application objects to incorporate our changes.

Getting ready

Solution versions can be changed only in SL1, SL2, SL3, BUS (and BUP) layers. SL1-SL3 layers are used for certified solutions and BUS— for business partner solutions. To proceed further, we will need the BUS layer code in order to log in to the BUS and BUP layers of the application.

How to do it...

  1. 1. Log in to the BUS layer, and modify sLxAppl() of the ApplicationVersion class to:

    private static client str sLxAppl()

    {
    return '1.0.0';
    }
  2. 2. Log in to the BUP layer, and modify the same method to:

    private static client str sLxAppl()

    {
    return '2.0.0';
    }
  3. 3. The class in AOT should look like this:

  1. 4. Open Help | About Microsoft Dynamics AX, and notice the Solution version numbers:

How it works...

The ApplicationVersion class is the place where application version numbers are stored. For example, applBuildNo() returns the current application version. By modifying this class, Dynamics AX developers can modify original or custom version numbers. Later this class is called from the SysAbout form, which is actually the About Microsoft Dynamics AX dialog.

The class already contains a special method sLxAppl(), which should be used when defining a custom solution version. The interesting point is that different version numbers can be stored in different layers. In our example, first we set a version in BUS, and then we change that version in the BUP layer. And the result is that we can see both numbers separated by a slash in the About Microsoft Dynamics AX dialog. The text Solution version is added automatically, though it could be also changed.

There's more...

Every Dynamics AX implementation project contains more or less customer-specific changes. Regardless of how big the modifications are, it is a good practice to use versioning. The modifications are normally stored in the VAR layer or any layer above it and are not included in automatic version display. However, if we look at the of the SysAbout form, we could notice that the information displayed on this form is actually formatted here. We can add our own code and relevant control to the form itself to display the custom name and version. So let's improve previous example and add an additional version called VAR version. run()

To follow existing practice, let's add one more method in the ApplicationVersion class first. (Do not forget to logout of BUP layer and log into your working layer). It will hold our version number:

static str varAppl()

{
return '3.0.0';
}

In AOT, open SysAbout form and add a new StaticText control for displaying version-related information with the following properties:

Property Value
Name VARVersion
AutoDeclaration Yes
Width Column width
BackStyle Transparent
Text  

The form in AOT should look like following:

And finally, we modify the form's run(). Let's add:

str varVersionNumber = ApplicationVersion::varAppl();

right after:

str slxVersionNumber = ApplicationVersion::sLxApplAll();

and:

if (varVersionNumber)
{
VARVersion.text('VAR version: ' + varVersionNumber);
}

right after:

if (slxVersionNumber)
application versionapplication versionworking{
solutionVersion.text('Solution version: ' +
slxVersionNumber);
}

Now, open Help | About Microsoft Dynamics AX again, and notice a new entry— VAR version:

In this way, you can customize the display of the About Microsoft Dynamics AX dialog to ensure that any custom modification or module is listed here along with its version for user information.
Other -----------------
- Microsoft Dynamics AX 2009 : Working with Forms - Modifying the User setup form
- Microsoft Dynamics AX 2009 : Working with Forms - Adding a Go to the Main Table Form link
- Designing and Optimizing Storage in an Exchange Server 2007 Environment (part 4)
- Designing and Optimizing Storage in an Exchange Server 2007 Environment (part 3) - Adding in Fault Tolerance for External Storage Systems
- Designing and Optimizing Storage in an Exchange Server 2007 Environment (part 2) - Designing the Right Data Storage Structure for Exchange Server 2007
- Designing and Optimizing Storage in an Exchange Server 2007 Environment (part 1) - When Is the Right Time to Implement NAS and SAN Devices?
- Engaging the SAP Solution Stack Vendors : General Sizing Best Practices and Approaches
- Engaging the SAP Solution Stack Vendors : Overview—The Sizing and Blueprinting Process
- Microsoft Dynamics AX 2009 : Working with Forms - Building checklists
- Microsoft Dynamics AX 2009 : Working with Forms - Using tree controls
- Active Directory Domain Services 2008 : Transfer the Schema Master Role
- Active Directory Domain Services 2008 : Identify Operations Master Role Holders
- Optimizing an Exchange Server 2007 Environment : Properly Sizing Exchange Server 2007
- Optimizing an Exchange Server 2007 Environment : Analyzing and Monitoring Core Elements
- SharePoint 2010 : Using Data Connection Libraries (part 1) - Connecting to Data Using Alternative Credentials & Configuring the Secure Store Service
- SharePoint 2010 : Using Data Connection Libraries (part 1) - Restricting Data Connection Types & Adding Connections to Data Connection Libraries
- SharePoint 2010 : Excel Services - Using the JavaScript Object Model
- Optimizing Exchange 2007 Servers & Monitoring Exchange Server 2007
- Optimizing an Exchange Server 2007 Environment : Analyzing Capacity and Performance
- Exchange Server 2010 : Planning Certificates for Autodiscover (part 2) - Deploying Exchange Certificates
 
 
Most View
- Exchange Server 2007 : Use Managed Content Settings
- BizTalk Server 2009 : Using asynchronous services in WCF (part 3) - Building a client-side asynchronous experience
- Sharepoint 2010 : Content Management - In place Records Management
- Windows 7 : Setting Up User Security - Renaming Built-In Accounts for Better Security
- SharePoint 2010 : Using Data Connection Libraries (part 1) - Connecting to Data Using Alternative Credentials & Configuring the Secure Store Service
- Overview of Internet Explorer 8 (part 3) - Using New Security and Safety Features of IE8 & Working with SmartScreen Filters
- SQL Server 2012 : T-SQL Enhancements - The MERGE Statement (part 1)
- SQL Server 2008 Scheduling and Notification : Configuring the SQL Server Agent
- Windows Small Business Server 2011 : Deploying a Second Domain Controller
- Exchange server 2010 : Troubleshooting Tools (part 1)
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS