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
*/
}

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
*/
}

06 December 2011

Query Filter using query

1.To filter the Record based on the Enumvalues
Reference Form is : HRCCompLevel
class FormRun extends ObjectRun
{
QueryBuildRange qR;
HRCCompType compType;
}
_____
DS->HRCCompLevel->
public void init()
{
super();

//qR = SysQuery::findOrCreateRange(HRCCompLevel_ds.queryBuildDataSource(), fieldnum(HRCCompLevel, Type));

qR = SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum(HRCCompLevel)), fieldnum(HRCCompLevel, Type));
qR.status(RangeStatus::Locked);
}
________
DS->HRCCompLevel->
public void executeQuery()
{
qR.value(queryValue(queryValue(compType)));
qR.value('*');// this is to get all records

super();

}
---------------------
public int selectionChange()
{
int ret;

ret = super();
transferStatus = this.selection();
InventTransferTable_ds.executeQuery();
return ret;
}
_________________________________________________________________
_________________________________________________________________
2.
public void init()
{
super();
qR = SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum

(InventTransferTable)), fieldnum(InventTransferTable, TransferStatus));
}
________________

public void executeQuery()
{
str queryExpression;
;
queryExpression = '(' +
queryValue(RBOInventTransferStatus::Created) + '.' +

Enum2str(RBOInventTransferStatus::Received) + '.'+
Enum2str(RBOInventTransferStatus::Shipped) + ')';

if(transferStatus == RBOInventTransferStatus::All)
{
qR.value('*');
}
else
qR.value(queryValue(queryValue(transferStatus)));

super();

}

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