Create a new method in standard table
Today we have a requirement to create a few new method on the standard table below are the example
[ExtensionOf(tableStr(EntAssetObjectTable))]
Final class IHSEntAssetObjectTableDbt_Extension
{
Public static EntAssetObjectTable ihsFindByAssetAndBarcode(EntAssetObjectID _assetID, String20 _barcodeNum, boolean _forUpdate = false)
{
EntAssetObjectTable objectTable;
if (_assetID && _barcodeNum)
{
objectTable.selectForUpdate(_forUpdate);
select firstOnly objectTable
where objectTable.ObjectID == _assetID
&& objectTable.IHSBarcode == _barcodeNum;
}
return objectTable;
}
========================================================================
public static EntAssetObjectTable ihsFindBySerialNumber(EntAssetObjectID _objectID,EntAssetSerialID _serialNumber, boolean _forUpdate = false)
{
EntAssetObjectTable objectTable;
if (_objectID)
{
objectTable.selectForUpdate(_forUpdate);
select objectTable
where objectTable.ObjectID == _objectID
&& objectTable.SerialID == _serialNumber;
}
return objectTable;
}
=========================================================================
Public static EntAssetObjectTable ihsFindByBarcode(String20 _barcodeNum, boolean _forUpdate = false)
{
EntAssetObjectTable objectTable;
if (_barcodeNum)
{
objectTable.selectForUpdate(_forUpdate);
select firstOnly objectTable
where objectTable.IHSBarcode == _barcodeNum;
}
return objectTable;
}
}
Comments
Post a Comment