码迷,mamicode.com
首页 > 其他好文 > 详细

AX 2012 Post a partial product receipt for a purchase order

时间:2016-12-06 14:32:29      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:convert   emd   tin   car   update   pass   pre   each   query   

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

标签:convert   emd   tin   car   update   pass   pre   each   query   

原文地址:http://www.cnblogs.com/fogfog/p/6137153.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!