SQL In <> Operator in BQL

Hi There,

Today want to show you example of amazing and very new BQL Operator – In<>.
This operator was added just recently with Acumatica version 2017R2, so now you can pass there an array of values and Acumatica core will convert it to SQL IN ( … ) statement.

Here is a code example:

Object[] values = new String[] { "AC", "IN" };

InventoryItem item = PXSelect<InventoryItem,
In<Required<InventoryItem.itemStatus>>>>.Select(Base, values);

This will be converted to following SQL

Select * from InventoryItem InventoryItem
Where InventoryItem.Status In ('AC', 'IN')
Order by InventoryItem.InventoryCD

Please note that In<> operator is available only with Required<> parameter and you need to pass array of possible values manually to Select(…) method parameters.

Have a nice development!

1 Reply to “SQL In <> Operator in BQL”

Leave a Reply

Your email address will not be published. Required fields are marked *