Operand types are not compatible with the operator.

Hi all,

I wrote a find method in the caeLOa table with the parameter as caeLoa field .But its throwing error “Operand types are not compatible with the operator.” Please let me know if something is wrong in the below method

public static CaeLoa find(caeLoa _loa,
boolean _forupdate = false)
{
CaeLOA caeloa = null;
;
caeloa.selectForUpdate(_forUpdate);

if (_loa)
{
select firstonly caeloa where caeloa.caeLoa == _loa;
}
return caeloa;

}

Thanks

Hi Sindhu,

Make sure that the data type for the field caeloa.caeLoa and parameter caeLoa are same.

Regards,

Raghav.

Try to modfiy your code in this way:

static CustTable find(CustAccount _custAccount,

boolean _forUpdate = false)

{

CustTable custTable;

;

if (_custAccount)

{

if (_forUpdate)

custTable.selectForUpdate(_forUpdate);

select firstonly custTable

index hint AccountIdx

where custTable.AccountNum == _custAccount;

}

return custTable;

}