Hello Everyone,
I need some help on RFQ performance process. RFQ process running very slowly in AX 2009 environment.
AP-> Common Forms-> Request for Quote Details
Create a request
Update -> Send
Click OK on Sending request for quote
Running TradeTotals class RFQ process getting slow. Path AOT \Classes\TradeTotals\calc - line 190.
if (calculateMarkupTableAmount)
{
queryOrderTableMarkup = this.queryBuildOrderTable();
while (queryOrderTableMarkup.next())
{
orderTableMarkup = this.queryGetOrderTable(queryOrderTableMarkup);
if (!orderTableMarkup)
continue;
viewCacheMarkupTrans = MarkupTrans::viewCacheMarkupTrans(this.markupTable(),false);
listViewCacheMarkupTrans.addEnd(viewCacheMarkupTrans);
markup.calc(1, this.totalOrderBalance(orderTableMarkup.RecId), this.markupTable(),this.documentStatus(), this.interCompanyLineAmount(1, tradeCalcTax.invoiceDate()));
markupTableAmount += this.markupCustVend(markup);
}
}
When I run this above code in Dev environment, the while loop executes 37,786 times. In my prod I have more than this number there its taking hours to RFQ process. The number is increasing on each time for RFQ process. When I skip the above logic in the Trade Totals class after that RFQ process working very faster.
The above logic is executed for sales order also.
Currently I am skipping this logic for RFQ process only using Boolean flag.
But I Just wanted to know what is use of this code? I kept the debugger and I tested but the while loop is executing for all the records in RFQ. I am sending RFQ for one record with some 3lines, but the debugger is looping for all the records in RFQ. When it comes to sales order while loop is executing one time only. Why it is not looping for all the records in sales order. Posting one RFQ I need to wait 10min the loop is running for all the RFQ in the table. The while loop is consuming more time to process for one single RFQ. I thought when I defined Miscellaneous charges so that I can able to understand this code, but the above logic will run with or without Miscellaneous charges. I am not sure thatMS Implementers are running some inefficient code in the above logic and this is the root cause to this problem.
Can anyone explain me the above logic and what is the use of this code.
Many Thanks,