Jini N
Jini N

Reputation: 28

Acumatica using In <> Operator in BQL for integer

We're trying to use IN operator on BQL to select multiple inventories, but it's not working. For example,

   int[] items = new int[] { 154, 184 };
   foreach (SOLine item in PXSelect<SOLine,Where<SOLine.inventoryID,In<Required<SOLine.inventoryID>>>>.Select(this, items))
    {

    }

I've also referred the blog below that illustrates using the IN operator for a string: https://asiablog.acumatica.com/2017/11/sql-in-operator-in-bql.html. We are trying for integer type in a similar way. I'm not sure what we're missing. It would be great if some one can help identify.

Upvotes: 0

Views: 548

Answers (1)

Hugues Beaus&#233;jour
Hugues Beaus&#233;jour

Reputation: 8278

Acumatica ORM entity DB types are all nullable. You are using an array of non-nullable values 'int[]' instead of an array of nullable values 'int?[]'.

Code:

int?[] items = new int?[] { 154, 184 };

foreach (SOLine item in PXSelect<SOLine, 
                        Where<SOLine.inventoryID, 
                        In<Required<SOLine.inventoryID>>>>.Select(this, items))
{

}

Upvotes: 1

Related Questions