AX 2012 Post a partial product receipt for a purchase order

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AX 2012 Post a partial product receipt for a purchase order相关的知识,希望对你有一定的参考价值。

Problem:Post a partial product receipt for a purchase order

Solution: We need to post partial product receipt for a purchase order. The lines to post are determined by the line number range You can add range on any field in purch line. The receive now quantity will specify the quantity to receive against each line.

purchTable = PurchTable::find(“PO1002228”);
update_recordSet  purchLine
setting purchReceivedNow = 1 , Inventreceivednow = 1
where purchLine.PurchId == purchTable.PurchId &&
purchLine.LineNumber == 1;

query = new Query(queryStr(PurchUpdate));//Query for the filter criteria
query.dataSourceTable(tableNum(PurchTable)).addRange(fieldnum   (PurchTable,PurchId)).value(queryValue(purchTable.PurchId));
query.dataSourceTable(tableNum(PurchLine)).addRange(fieldNum(PurchLine,LineNumber)).value(queryValue(1));
chooseLinesQuery = new SysQueryRun(query);
purchFormLetter = PurchFormLetter_PackingSlip::newPackingSlipFromChooseLineQuery(chooseLinesQuery,purchTable); //pass in _purchid,
purchFormLetter.update( purchTable,
“PA0093”,//product receipt number
systemDateGet(),//trans date
PurchUpdate::ReceiveNow,//Receive now
AccountOrder::None,
false,
false);

以上是关于AX 2012 Post a partial product receipt for a purchase order的主要内容,如果未能解决你的问题,请参考以下文章

AX 2012 现有量表加字段

AX2012 getDefaultDimensionFromLedgerDimension

AX2012修改properties字体

Dynamics AX 2012 R2 AIF 内部异常

The new concept 'Model' in AX 2012

AX 2012 MophX Report Export To File