16 December 2011

Transfer Orders Post Picking List, Ship and Received in Code / auto post TransferOrder

Transfer Orders Auto Posting - Picking List, Ship and Received

To Post a TO receipt list in code, you can do the following:

void TO_PostPickList(InventTransferId transferId)
{
//will post the pick list.
InventTransferParmTable itpt;
InventTransferUpdPick itup;
;

//make sure we haven't already posted the pick list
//if the TO is changed, this will return a false positive and won't re-post the pick list
//TODO beef up the check on whether or not the Pick List should be postsed
select * from itpt where itpt.TransferId == transferId &&
itpt.UpdateType == InventTransferUpdateType::PickingList;

if(itpt.RecId == 0)
{

itpt.clear();
itpt.initParmDefault();

itpt.ParmId = RunBaseMultiParm::getSysParmId();
itpt.TransferId = transferId;
itpt.UpdateType = InventTransferUpdateType::PickingList;
itpt.PrintTransferPickingList = NoYes::No;
itpt.PickUpdateQty = InventTransferPickUpdateQty::All;
itpt.EditLines = NoYes::Yes;
itpt.ExplodeLines = NoYes::Yes;

itpt.InventDimFixedReceiveList = 0; // See note below on how to compute this.

itup = InventTransferUpdPick::newParmBuffer(itpt);

itup.run();
}
/*
#DEFINE.INVENTLOCATIONID_IDX(0)
#DEFINE.BATCH_IDX(1)
#DEFINE.LOCATION_IDX(2)
#DEFINE.PALLET_IDX(3)
#DEFINE.SERIALID_IDX(4)
#DEFINE.CONFIGID_IDX(5)
#DEFINE.INVENTSIZEID_IDX(6)
#DEFINE.INVENTCOLORID_IDX(7)

binary: 11110101
decimal: 245
*/
}
________________
To Post a TO receipt list in code, you can do the following:

void TO_PostReceipt(inventTransferId transferId)
{
InventTransferParmTable itpt;
InventTransferUpdReceive itur;
;

itpt.clear();
itpt.initParmDefault();

//TODO add check to make sure this is only posted if it needs to be posted

itpt.ParmId = RunBaseMultiParm::getSysParmId();
itpt.TransferId = transferId;
itpt.UpdateType = InventTransferUpdateType::Receive;
itpt.PrintTransferReceipt = NoYes::No;
//itpt.ReceiveUpdateQty = InventTransferReceiveUpdateQty::Registered;
itpt.ReceiveUpdateQty = InventTransferReceiveUpdateQty::All;
itpt.EditLines = NoYes::Yes;
itpt.ExplodeLines = NoYes::Yes;

itpt.InventDimFixedReceiveList = 245; // See note below on how to compute this.

itur = InventTransferUpdReceive::newParmBuffer(itpt);

itur.run();

/*
#DEFINE.INVENTLOCATIONID_IDX(0)
#DEFINE.BATCH_IDX(1)
#DEFINE.LOCATION_IDX(2)
#DEFINE.PALLET_IDX(3)
#DEFINE.SERIALID_IDX(4)
#DEFINE.CONFIGID_IDX(5)
#DEFINE.INVENTSIZEID_IDX(6)
#DEFINE.INVENTCOLORID_IDX(7)

binary: 11110101
decimal: 245
*/
}
____________________
To Post a TO Ship in code, you can do the following:
void TO_PostShip(inventTransferId transferId)
{
InventTransferParmTable inventTransferParmTable;
InventTransferUpdShip inventTransferUpdShip;
;
inventTransferParmTable.clear();
inventTransferParmTable.initParmDefault();

//TODO add check to make sure this is only posted if it needs to be posted

inventTransferParmTable.ParmId = RunBaseMultiParm::getSysParmId();
inventTransferParmTable.TransferId = transferId;
inventTransferParmTable.UpdateType = InventTransferUpdateType::Shipment;
inventTransferParmTable.PrintTransferReceipt = NoYes::No;
inventTransferParmTable.ShipUpdateQty = InventTransferShipUpdateQty::All;
inventTransferParmTable.EditLines = NoYes::Yes;
inventTransferParmTable.ExplodeLines = NoYes::No;

inventTransferParmTable.InventDimFixedReceiveList = 0;// See note below on how to compute this

inventTransferUpdShip = InventTransferUpdShip::newParmBuffer(inventTransferParmTable);

inventTransferUpdShip.run();
/*
#DEFINE.INVENTLOCATIONID_IDX(0)
#DEFINE.BATCH_IDX(1)
#DEFINE.LOCATION_IDX(2)
#DEFINE.PALLET_IDX(3)
#DEFINE.SERIALID_IDX(4)
#DEFINE.CONFIGID_IDX(5)
#DEFINE.INVENTSIZEID_IDX(6)
#DEFINE.INVENTCOLORID_IDX(7)

binary: 11110101
decimal: 245
*/
}

6 comments:

  1. Hi ,

    I have a requirement to create and post the transfer order through AIF services. i can create the transfer order through InventTransferOrderCreate service . i am struggling here to post picking list , ship, receive while using InventTransferorderPosting service . when am running the below code from VS am getting the error no lines for posting in the exception .. please advice how to achieve this from C# code.

    invTrnsPrmTbl.TransferId = "DE-000002";//returnedTransferOrder.KeyData[0].Value;
    invTrnsPrmTbl.UpdateType = AxdEnum_InventTransferUpdateType.Shipment;
    invTrnsPrmTbl.UpdateTypeSpecified = true;
    invTrnsPrmTbl.ShipUpdateQty = AxdEnum_InventTransferShipUpdateQty.All;
    invTrnsPrmTbl.ShipUpdateQtySpecified = true;
    //invTrnsPrmTbl.AutoReceiveQty = TransferOrderPostingRef.AxdExtType_InventTransferAutoReceiveQty.Yes;
    invTrnsPrmTbl.EditLines = TransferOrderPostingRef.AxdExtType_InventTransferEditLines.Yes;
    invTrnsPrmTbl.EditLinesSpecified = true;
    invTrnsPrmTbl.ExplodeLines = TransferOrderPostingRef.AxdExtType_NoYesId.No;
    invTrnsPrmTbl.ExplodeLinesSpecified = false;
    TransferOrderPosting.IvTrnsPrmTbl = new AxdEntity_IvTrnsPrmTbl[1] { invTrnsPrmTbl };

    OrderPost.create(PostCallContxt,TransferOrderPosting);

    thanks in advance ,

    regards,
    Mani

    ReplyDelete
  2. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post. Shipping จีน

    ReplyDelete
  3. Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next.. インド観光ビザ

    ReplyDelete
  4. https://james-hunker.blogspot.com/2015/07/30-windows-10-recycle-bin-icon-download.html?showComment=1646131810614#c4005120070777084320

    ReplyDelete
  5. You've created a whole heap of relevant content for your website. You've got some good in-bound links from high page ranking websites and your website is fully optimized for all the keywords and key-phrases your customers are searching upon - great. robotic bin picking

    ReplyDelete
  6. This is really helpful, thanks

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...