26.10.2009, 20:05 | #1 |
Участник
|
Dynamics AX Sustained Engineering: Performance issue in "Open Transaction Edit" form
Источник: http://blogs.technet.com/dynamicsaxs...edit-form.aspx
============== 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 : \Forms\VendOpenTrans\Designs\Design\[Tab:TabControl]\[TabPage:OverviewTab]\[Grid:OverviewGrid] 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. \Forms\VendOpenTrans\Designs\Design\[Tab:TabControl]\[TabPage:OverviewTab]\[Grid:OverviewGrid] … super(); overviewGrid.autoSizeColumns (false); //added line switch (originator.TableId) … The Company info table is updated: A new field is added called DataArea which uses extended data type “CompanyID” Method initValue() has 1 line added to populate the new field when a new company record is created. void initValue() { super(); this.dataAreaId = 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. /// /// /// The customer or vendor account number that is used to initialize the balance. /// /// /// A Boolean value that indicates whether to initialize the posted customer balance or the vendor /// balance. /// protected void initCustVendBalanceMst(AccountNum _custVendAccount, boolean _isCustomerAccount) { DirPartyId custVendPartyId; CustVendTrans custVendTrans; CustTrans custTrans; VendTrans vendTrans; CustVendTable custVendTable; CustTable custTable; VendTable vendTable; CurrencyCode transMstCurrency; Amount transMstBalance; CurrencyExchHelper currencyExchHelper; CompanyInfo companyInfo; changecompany(custVendCompany) { if (_isCustomerAccount) { custTable = CustTable::find(_custVendAccount); custVendPartyId = custTable.PartyId; custVendTrans = custTrans; custVendTable = custTable; } else { vendTable = VendTable::find(_custVendAccount); custVendPartyId = vendTable.PartyId; custVendTrans = vendTrans; custVendTable = vendTable; } } // Initialize currency exchange helper currencyExchHelper = CurrencyExchHelper::construct(); currencyExchHelper.parmCompany(displayCompany); while select crossCompany:sharedServiceCompanies sum(AmountMst), CurrencyCode, AccountNum from custVendTrans order by companyInfo.CurrencyCode asc group by companyInfo.CurrencyCode 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. currencyExchHelper.parmCurrency(transMstCurrency); transMstBalance = currencyExchHelper.calculateAmountCurToMst(transMstBalance, true); } else { // Otherwise the balance from that company should not be added to the total. transMstBalance = 0; } } custVendBalanceMst += transMstBalance; } } Источник: http://blogs.technet.com/dynamicsaxs...edit-form.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|