Hi everyone,
so i have created a table that have fields that it gets from two different tables with foreing key relations or table methods, the table I created have a primary index that is the combination of two fields (every value in the table can exist multiple times and I wanted on the combination of two fields to be unique) so my question is: how to create the exist method that uses these two fields of the primary index to determine if a record exist ?
This is what i tried out but it returns multiple errors:
<> static boolean exist(ILBMaterialCode _materialCode, ItemIdBase _itemId)
{
ILBReleasedProductMaterials iLBReleasedProdMat;
boolean vExist = boolean::false;
if(_materialCode)
{
if(_itemId)
{
vExist = boolean::true;
}
}
return vExist && (select firstonly RecId iLBReleasedProdMat
index hint ProductMaterialsIdx
where iLBReleasedProdMat.MaterialCode == _materialCode &&
iLBReleasedProdMat.ProductNumber == _itemId).RecId != 0;
}
</>
I appreciate every bit of help I can get ^^.