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_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 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 = inventTransferTable.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
*/
}

No comments:

Post a Comment

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->...