首页 > 解决方案 > Acumatica 在 BQL 中将 In <> 运算符用于整数

问题描述

我们正在尝试IN在 BQL 上使用运算符来选择多个库存,但它不起作用。例如,

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

    }

我还参考了下面的博客,该博客说明了将 IN 运算符用于字符串: https ://asiablog.acumatica.com/2017/11/sql-in-operator-in-bql.html 。我们正在以类似的方式尝试整数类型。我不确定我们缺少什么。如果有人可以帮助识别,那就太好了。

标签: operator-keywordacumatica

解决方案


Acumatica ORM 实体数据库类型都可以为空。您正在使用一个不可为空值的数组“int []”,而不是一个可以为空值的数组“int?[]”。

代码:

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

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

}

推荐阅读