martedì 14 ottobre 2014

HOWTO: Create invent marking

Here an exaple for create a mark by code:

InventTrans issueInventTrans;
TmpInventTransMark tmpInventTransMask;
Map mapMarkNow;
container con;
real qty;
Map mapTmp;
MapEnumerator mapEnumerator;

InventTransOriginId issueInventTransOriginId = 
InventTransOrigin::findByInventTransId('Issue lot ID').RecId;

InventTransOriginId receiptInventTransOriginId = 
InventTransOrigin::findByInventTransId('Receipt lot ID').RecId;    

InventQty qtyToMark = 11;

ttsBegin;

issueInventTrans = InventTrans::findByInventTransOrigin(
issueInventTransOriginId);

[con, qty] = TmpInventTransMark::packTmpMark(
InventTransOrigin::find(issueInventTransOriginId),
issueInventTrans.inventDim(), 
issueInventTrans.Qty);

mapTmp = Map::create(con);
mapEnumerator = mapTmp.getEnumerator();
while (mapEnumerator.moveNext())
{
tmpInventTransMask = mapEnumerator.currentValue();

if (tmpInventTransMask.InventTransOrigin == receiptInventTransOriginId)
{
tmpInventTransMask.QtyMarkNow = qtyToMark;
tmpInventTransMask.QtyRemain -= tmpInventTransMask.QtyMarkNow;
mapMarkNow = new Map(Types::Int64, Types::Record);
mapMarkNow.insert(tmpInventTransMask.RecId, tmpInventTransMask);

TmpInventTransMark::updateTmpMark(
issueInventTransOriginId, 
issueInventTrans.inventDim(), 
-qtyToMark,
mapMarkNow.pack());

break;
}
}

ttsCommit;

Nessun commento:

Posta un commento

AX 2012: The request was aborted: Could not create SSL/TLS secure channel

The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...