Share via


TmpInventTransMark::inventTransUnmark Method

Select transactions to be unmarked.

Syntax

server public static InventTrans inventTransUnmark(
    InventTransOriginId _inventTransOriginId, 
    InventDim _inventDimCriteria, 
    InventQty _qty, 
    TmpInventTransMark _tmpInventTransMark, 
    Integer _loop)

Run On

Server

Parameters

  • _inventDimCriteria
    Type: InventDim Table
    The _inventDimCriteria parameter is used as the selection criteria when the _loop parameter is not zero.
  • _qty
    Type: InventQty Extended Data Type
    The quantity of the transaction in which the sign of the quantity indicates whether the selection is performed for a receipt or an issue.
  • _tmpInventTransMark
    Type: TmpInventTransMark Table
    The temporary information about a transaction to be unmarked against the selected InventTrans transactions.
  • _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 to be unmarked, the value can be increased and this method is called again.

Return Value

Type: InventTrans Table
The transactions referred to the _tmpInventTransMark.InventTransOrigin parameter value.

Remarks

As the transactions are always unmarked in both directions (Issue<->Receipt), there is another method, the TmpInventTransMark method, which retrieves transactions referred to the _inventTransOriginId parameter value.

Examples

server static void unmarkTransactions(
                                InventTransId _inventTransOriginId, 
                                InventDim _inventDimCriteria, 
                                InventQty _qty, 
                                tmpInventTransMark _tmpInventTransMark) 
{ 
    Integer     loop = 0; 
    InventQty   qtyRemain; 
    InventTrans inventTrans; 
    InventTrans inventTransTmp; 
    ; 
 
    // The quantity to be unmarked 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
 
    while (loop < 2) 
    { 
        // Select transactions to be unmarked 
        inventTrans = TmpInventTransMark::inventTransUnmark( 
                                      _inventTransOriginId, 
                                      _inventDimCriteria, 
                                      _qty, 
                                      _tmpInventTransMark, 
                                      loop); 
        while (inventTrans.recId) 
        { 
            // Unmark transactions. 
 
            qtyRemain -= abs(inventTrans.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
            next inventTrans; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
 
        loop++; 
    } 
 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
    loop = 0; 
 
    while (loop < 2) 
    { 
        // Select transactions to be unmarked 
        inventTransTmp = TmpInventTransMark::inventTransUnmarkTmp(
                                         _inventTransOriginId, 
                                         _inventDimCriteria, 
                                         _qty, 
                                         _tmpInventTransMark, 
                                         loop); 
        while (inventTransTmp.recId) 
        { 
            // Unmark transactions. 
 
            qtyRemain -= abs(inventTransTmp.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTransTmp; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
 
        loop++; 
    } 
}

See Also

Reference

TmpInventTransMark Table