最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

通过X ++进行标记 / Marking via X++

网络文摘 William 44浏览 0评论
X++ code for marking in D365FO (it is somewhat different from that in AX 2012):
    InventTransId         issueInventTransId   = 'x';
    InventTransId         receiptInventTransId = 'y';
 
    InventTransOriginId receiptInventTransOriginId = 
        InventTransOrigin::findByInventTransId(receiptInventTransId).RecId;
    InventTrans         receiptInventTrans         = 
        InventTrans::findByInventTransOrigin(receiptInventTransOriginId);
 
    InventTransOriginId issueInventTransOriginId = 
        InventTransOrigin::findByInventTransId(issueInventTransId).RecId;
    InventTrans         issueInventTrans       = 
        InventTrans::findByInventTransOrigin(issueInventTransOriginId);
 
    collection = TmpInventTransMark::markingCollection(
        InventTransOrigin::find(receiptInventTransOriginId),
        receiptInventTrans.inventDim(),
        receiptInventTrans.Qty);
 
    collection.insertCollectionToTmpTable(tmpInventTransMark);
 
    select firstonly tmpInventTransMark
        where tmpInventTransMark.InventTransOrigin == issueInventTrans.InventTransOrigin
           && tmpInventTransMark.InventDimId       == issueInventTrans.InventDimId;
 
    if (tmpInventTransMark.RecId != 0)
    {
        Qty qtyToMark = issueInventTrans.Qty;
 
        tmpInventTransMark.QtyMarkNow =  qtyToMark;
        tmpInventTransMark.QtyRemain  -= tmpInventTransMark.QtyMarkNow;
 
        mapUpdated = new Map(Types::Int64, Types::Record);
        mapUpdated.insert(tmpInventTransMark.RecId, tmpInventTransMark);
 
        TmpInventTransMark::updateTmpMark(
                receiptInventTransOriginId,
                receiptInventTrans.inventDim(),
                -qtyToMark,
                mapUpdated.pack());
    }
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址