I am just trying to update the PurchPrice of some lines in a Purchase order.
for that, I wrote a simple loop to update the prices one by one.
do
{
row++;
lineNumber = cells.item(row, 1).value().double();
purchId = cells.item(row, 2).value().bStr();
purchPrice = cells.item(row, 3).value().double();
type = cells.item(row+1, 1).value().variantType();
select forUpdate purchLine
where purchLine.PurchId == purchId
&& purchLine.LineNumber == lineNumber;
if (purchLine)
{
purchLine.PurchPrice = purchPrice;
purchLine.LineAmount = purchLine.PurchPrice * purchLine.QtyOrdered;
purchLine.update();
doneCntr++;
}
}
while (type != COMVariantType::VT_EMPTY);
but I understood that the task is extremely slow (it takes hours to update 100 lines). so, I tried to figure out the reason with Trace Parser. and the following is the result of this experiment. It takes a long time to do TaxPurch::calculateTax

Would you please help me find out the answer to following questions?
Why is this action so slow?
What this action is for and do I have to perform it just for updating PurchPrice?
How can I fix it?
*This post is locked for comments
I have the same question (0)