Share via


TmpInventTransMark::inventTransMarkTmp Method

Selects transactions that are to be marked.

Syntax

server public static InventTrans inventTransMarkTmp(
    InventTransOriginId _inventTransOriginId, 
    InventQty _qty, 
    TmpInventTransMark _tmpInventTransMark, 
    Integer _loop)

Run On

Server

Parameters

  • _qty
    Type: InventQty Extended Data Type
    The quantity of the transaction in which sign of the quantity indicates whether the selection is performed for a receipt or an issue.
  • _loop
    Type: Integer Extended Data Type
    The number of tries to select the transactions. Usually at the start it is set to zero. If the quantity of selected transactions is not enough for the marking, the value can be increased and this method is called again.

Return Value

Type: InventTrans Table
The transactions to be marked against an issue or receipt with the _inventTransOriginId parameter value.

Remarks

As the marking is always done in both directions (Issue<->Receipt), there is another method, the TmpInventTransMark method, which retrieves transactions to be marked against an issue or receipt with the _tmpInventTransMark.InvenTransOrigin parameter value.

Examples

server static void markTransactions( 
                                InventTransOriginId _inventTransOriginId, 
                                InventDim _inventDimCriteria, 
                                InventQty _qty, 
                                tmpInventTransMark _tmpInventTransMark) 
{ 
    Integer loop = 0; 
    InventQty   qtyRemain; 
    InventTrans inventTrans; 
    InventTrans inventTransTmp; 
    ; 
 
    // The quantity to be marked 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
 
    while (loop < 4) 
    { 
        // Select transactions to be marked against _tmpInventTransMark 
        inventTrans = TmpInventTransMark::inventTransMark( 
                                    _inventTransOriginId, 
                                    _inventDimCriteria, 
                                    _qty, 
                                    _tmpInventTransMark, 
                                    loop); 
        while (inventTrans.recId) 
        { 
            qtyRemain -= abs(inventTrans.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTrans; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
        loop++; 
    } 
 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
    loop = 0; 
 
    while (loop < 3) 
    { 
        // Select transactions to be marked against _inventTransId 
        inventTransTmp = TmpInventTransMark::inventTransMarkTmp(
                                       _inventTransOriginId, 
                                       _qty, 
                                       _tmpInventTransMark, 
                                       loop); 
        while (inventTransTmp.recId) 
        { 
            qtyRemain -= abs(inventTransTmp.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTransTmp; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
 
        loop++; 
    } 
}

See Also

Reference

TmpInventTransMark Table