Alright, so we have a need to be able to categorize material as being on quality hold or waiting for recycling, or another status. I solved this by creating a new MaterialStatus table, with a status enum and a serial number which I can use to link it. If material is good/normal then it will not have a row in the MaterialStatus table unless it’s been given another status and then later specified to be good status after all.
Previously for raw materials used a view named utRaw, so I just added my new table to the view using an outer join:

As you can see, for most records MaterialStatus on the right is null. This means that it’s good material. When allocating material or telling the forklift driver which material to bring, it’s important that we only bring good material.
Now, the following document explains that null values are treated as 0 (the default value) for enums:
https://docs.microsoft.com/en-us/dynamicsax-2012/developer/null-values-for-data-types
Well, with my Enum 0 corresponds to the Good value, so this query should return all rows that have no link, ie null in their material status.

But it doesn’t. Turns out this only returns rows where materialstatus is not null and materialstatus == 0.
I tried everything I could, but there seems to be no way to get the inline query to work. However, if the check isn’t in the SQL statement then it works fine:

I view this as a failure of the inline SQL in AX. Does anyone know a way to write a query for this?