Create Find Methode using x++ :
static public InventDim find(
    InventDimId _inventDimId,
    boolean     _forupdate = false)
{
    InventDim inventDim;
    if
(_inventDimId)
    {
        if
(_forupdate)
        {
            inventDim.selectForUpdate(_forupdate);
        }
        select
firstonly inventDim
            where
inventDim.InventDimId  == _inventDimId;
    }
    return
inventDim;
}
static public InventLocation BIT_find_NamaGudang(
    Inventlocationid    _InventlocationId,
    boolean             _forupdate = false)
{
    InventLocation  _InventLocation;
    if(_InventlocationId)
    {
        if(_forupdate)
        {
           
_InventLocation.selectForUpdate(_forupdate);
        }
        select
firstOnly _InventLocation
            where
_InventLocation.InventLocationId == _InventlocationId;
    }
    return
_InventLocation;
}
static
SalesLine findInventTransId(TradeInventTransId _transId,
                                   boolean            _update = false )
{
    SalesLine salesLine;
    if
(_transId)
    {
        if
(_update)
        {
            salesLine.selectForUpdate(_update);
        }
        select
firstonly salesLine
            index hint TransIdIdx
            where
salesLine.InventTransId == _transId;
    }
    return
salesLine;
}
static
RUM_MasterProjectLines findItemID(
        ItemIdInventoried _ItemIdInventoried,
        boolean             _update = false)
{
    RUM_MasterProjectLines  _RUM_MasterProjectLines;
    if(_ItemIdInventoried)
    {
        if(_update)
        {
           
_RUM_MasterProjectLines.selectForUpdate(_update);
        }
        select
firstOnly _RUM_MasterProjectLines
            index hint ItemNumberIdx
            where
_RUM_MasterProjectLines.ItemNumber == _ItemIdInventoried;
    }
    return
_RUM_MasterProjectLines;
}
Example :
Gudang      =
Inventdim::find(_vendPackingSlipTrans.InventDimId).InventLocationId;
Nama_Gudang =
InventLocation::BIT_find_NamaGudang(Inventdim::find(_vendPackingSlipTrans.InventDimId).InventLocationId).Name;


0 comments:
Post a Comment