SE has noticed a performance issue in “Open Transaction Edit” form (AP >> Vendor Details form >> "Open Transaction Editing") in AX 2009 SP1. Post our investigations, we see that much time is consumed sizing the grid columns. Implementing a customization on the VendOpenTrans form will significantly reduce the time needed to open the form. ON test results from our end , we saw an improvement from 60 seconds to 11 seconds post implementing this customization .
Please note that you can also utilize the customization on various other forms that pose the same impact in performance reasons. Below are details on how to work around this issue by making changes to the \forms\VendOpenTrans with some code snippets given below.
Pre requisite : Ensure to have KB 968397 installed on both the client & server. This KB is also included Ax 2009 SP1 Roll-up 2 and is available here
Code snippets :
Change the AutoDeclaration Property from No to Yes.
The code snippet below contains an addition of “overviewGrid.autoSizeColumns(false)” which was a kernel method that was introduced by the referenced KB 968397 fix.
(NOTE: This change can be applied to the CustOpenTrans form as well)
overviewGrid.autoSizeColumns (false); //added line
The Company info table is updated:
A new field is added called DataArea which uses extended data type “CompanyID.” The following SQL Statement can be used to update the new field with the proper data:
UPDATE COMPANYINFO SET DATAAREA = DATAAREAID
Method initValue() has 1 line added to populate the new field when a new company record is created.
this.dataArea = this.dataAreaId; //line added
this.LanguageId = new Session().interfaceLanguage();
Secondly the entire CustVendOpenTransBalances.initCustVendBalanceMst() method is re-written as follows:
/// Initializes the posted customer or vendor balance in the monetary standard (MST) currency.
/// <param name="_custVendAccount">
/// The customer or vendor account number that is used to initialize the balance.
/// <param name="_isCustomerAccount">
/// A Boolean value that indicates whether to initialize the posted customer balance or the vendor
protected void initCustVendBalanceMst(AccountNum _custVendAccount, boolean _isCustomerAccount)
custTable = CustTable::find(_custVendAccount);
custVendPartyId = custTable.PartyId;
custVendTrans = custTrans;
custVendTable = custTable;
vendTable = VendTable::find(_custVendAccount);
custVendPartyId = vendTable.PartyId;
custVendTrans = vendTrans;
custVendTable = vendTable;
// Initialize currency exchange helper
currencyExchHelper = CurrencyExchHelper::construct();
while select crossCompany:sharedServiceCompanies sum(AmountMst), CurrencyCode, AccountNum from custVendTrans
order by companyInfo.CurrencyCode asc
group by companyInfo.CurrencyCode, custVendTrans.AccountNum
join DataArea, CurrencyCode from companyInfo
where companyInfo.DataArea == custVendTrans.dataAreaId
exists join AccountNum, PartyId from custVendTable
where custVendTable.AccountNum == custVendTrans.AccountNum
&& custVendTable.PartyId == custVendPartyId
transMstCurrency = companyInfo.CurrencyCode;
transMstBalance = custVendTrans.AmountMST;
// Convert to the company currency of the display company using the system date and the display company exchange rate, if necessary
if (transMstCurrency != displayMstCurrency)
if (Currency::existByCompany(displayCompany, transMstCurrency))
// Calculate the balance from the transaction company if its currency exists in the display company.
transMstBalance = currencyExchHelper.calculateAmountCurToMst(transMstBalance, true);
// Otherwise the balance from that company should not be added to the total.
transMstBalance = 0;
custVendBalanceMst += transMstBalance;
open AOT find table VENDTRANSCASHDISC
create a new index...:
"ExampleIdx" (allow duplicates == no)
add these fields to the index...:
REFRECID,REFTABLEID,CASHDISCDATE, RECID, DATAAREAID, PARTITION