QueryBuildDataSource against a method

I’m pretty new to AX development. We want to modify our SalesLine item lookup so that it only lists items that have the Stopped property checked in the InventItemSalesSetup table.

My thinking was that I would add a method to InventTable called isStopped() that would then look it up in the InventItemSalesSetup table.

But then when I was creating the lookup() override, and I got to the QueryBuildDataSource part, I couldn’t figure out how to get it to query on items based on a method instead of a field. Is there a way to do this?

which can be achieved by constructing a query and filtering the records.

Have a look at the underneath threads.

Usingqueries

Using Views Multi table lookup

Do you really want to show the stopped items?

For reference look at \Data Dictionary\Tables\InventTable\Methods\lookupItemIdDefaultOrderType

Remember that some of the default order settings for item can be overridden on site specific order settings.

Also tag the AX version.

Krishna and Kranthi, thank you for the samples. I’ll check them out. Kranthi, I mis-typed that. I meant items that have the stopped property unchecked, not checked.