Trap typecast

Typecast from int64(RecId) to boolean
(tested in DynamicsAX 2009)

the implicit typecast from int/int64 to boolean is often used in ax sources...

public boolean exist( EDT _value) {   return (select * from table where table.field == _value).recId; }

BUT.....

when the RecId (as 64bit integer) last 8 bits are 0 the typecast results in a false even though the RecId is not 0

so, take a look at the bestpractice (design patterns for table exist method)

when you'll need a boolean, than use a boolean expression !!! return (table.RecId != 0)