Reputation: 28
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
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