Skip to main content

Managing Client Versions

How do you know if you have updated all of your client machines to the correct and current AX version?
For a lot of companies that have distributed clients, managing the client software can be somewhat of a headache for the IT staff. As the roll out of new kernel builds are released, it is important to make sure the client applications are updated as well. It is especially difficult if the client applications are located on mobile machine or computers that may not be inaccessible locations due to a variety of business requirements.
The following code suggestion can be put into the AOD to help prevent client side applications from logging into the production system when it has not been updated to the correct kernel version.
When our Premier Field Engineer team performs a Health Check, we will check the client executable to make sure they are on the same kernel version as the AOS. This helps improve the AX environments stability.

1) Within the AOT, create a new class
a. In the following code example the class name is DAX_ClientVersionCheck
b. Create a new method under the class called MAIN
c. Copy the following code into the method:
static void main(Args _args)
{
str currentVersion = '5.0.1500.1670'; // change this to desired kernel version
str msgText;
;
if (currentVersion != xInfo::releaseVersion()+ '.' + xInfo::buildNo())
{
msgText = "The client version needs to be updated to: " + currentVersion + ".\nCurrent version is " + xInfo::releaseVersion()+ '.' + xInfo::buildNo() + "\n\nPlease contact your System Administrator";
box::Warning(respText,"Client version issue");
// remove the following commenting on the next line to force client shutdown
//infolog.shutDown(true);
}
}
2) Change the variable currentVersion to the desired Kernel version number.
3) Save this class.
4) Open the "Info" Class.
5) Locate and open the method " workspaceWindowCreated" in the X++ editor
6) Modify the "workspaceWindowCreated" method to look like this:
void workspaceWindowCreated(int _hWnd)
{
// Put workspace window specific initialization here.
UserInfo userInfo;
Args args; // DAX modification
select firstonly AutoLogOff
from userInfo
where userInfo.Id == curuserid();
if (userInfo && userInfo.AutoLogOff)
this.setTimeOut(identifierstr(autologoff), userInfo.AutoLogOff*1000*60, true);

this.setTimeOut(identifierstr(watchDog), #watchdogInterval, false);
// DAX modification for startup test
DAX_ClientVersionCheck::main(args);
}
7) Save this code.
8) Exit AX and restart.
9) Run a Test. You should an info box message if the client version does not match:
10) Go back to the AOT
11) Change the MAIN method on DAX_ClientVersionCheck by uncommenting the following line:
//infolog.shutdown(true);
12) Save, Exit, and restart AX
13) Now when a user tries to log-in with an incorrect client application, they will be stopped until their client application matches the version number placed in the Class code.

Popular posts from this blog

What does this mean: "The form datasource query object does not support changing its AllowCrossCompany property after the form has executed the query."?

I have made a form with datasources vendtable and vendtrans. Inside vendtable_ds.executequery() looks like this: QueryBuildDataSource queryBuildDatasource ,queryBDS_VendTrans_Invoice; ; queryBuildDatasource = this.query().dataSourceTable(tablenum(vendtable)); queryBDS_VendTrans_Invoice = this.query().dataSourceTable(tablenum(vendtrans)); if (curext() == "MASTERCOMP") { this.query().allowCrossCompany(true); } else { this.query().allowCrossCompany(false); } //FilterVendorName = stringedit control on form if (FilterVendorName.text()) { queryBuildDatasource.addRange(fieldNum(VendTable,Name)).value(strfmt("*%1*", FilterVendorName.text())); } else { queryBuildDatasource.clearRange(fieldNum(VendTable,Name)); } //FilterInvoiceNumber = stringedit control on form if (FilterInvoiceNumber.valueStr() == "") { queryBDS_VendTrans_Invoice.enabled(false); } else { queryBDS_VendTrans_Invoice.enabled(true); queryBDS_VendTrans_In...

Credit Note [Dynamics AX] using X++

This post will help to create credit note for a sales order based on the invent lot id. All the invoices raised for a particular sales line – Lot Id will be raised back as a credit note. Information on Credit Note: A credit note or credit memorandum (memo) is a commercial document issued by a seller to a buyer. The seller usually issues a Credit Memo for the same or lower amount than the invoice, and then repays the money to the buyer or sets it off against a balance due from other transactions Below Code will help to create credit note for all the invoices raised against the sales line -lot id. Please note: This code can be customized as per your requirements. This is just a template to help creating credit note using X++ code. Please test the code before use. static void SR_CreateCreditNote_Sales(Args _args) { // Coded by Sreenath Reddy CustInvoiceTrans custInvoiceTrans; Dialog dialog = new Dialog(“Create credit note – for sales.”); DialogField dfInv...