可以调用标准函数
Purchline::ModifyPurchQty(purchLine,inventDim);
InventMovement::bufferSetRemainQty(purchLine);
sample source:
PurchQty q;
q = 800;
avoidBox = true;
select forupdate _pLine where _pLine.PurchId == "02691700" && _pLine.LineNum == 5;
ttsbegin;
_pLine.PurchQty = q;
PurchLine::modifyPurchQty(_pLine, InventDim::find(_pLine.InventDimId), avoidBox);
InventMovement::bufferSetRemainQty(_pLine);
_pLine.update();
ttscommit;
http://microsoft.public.axapta.narkive.com/LT7hVitW/8648-1-can-i-simply-use-the-function-purchline-modifypurchqty-to-alter-the-purchqty