【发布时间】:2015-12-14 18:36:53
【问题描述】:
var filterExp = [
[ ['custrecord_rebate_customer.isinactive', 'is', 'F'],
'and',
['custrecord_rebate_customer.custrecord_start_date', 'before', date],
'and',
['custrecord_rebate_customer.custrecord_end_date', 'after', date],
'and',
['custrecord_rebate_customer.custrecord_upaya_warehouse', 'anyof', warehouse],
'and',
['isinactive', 'is', 'F' ],
'and',
['custrecord_customer_name', 'anyof', customer]],
'or',
['custrecord_rebate_customer.custrecord_global_clearance_item','is','T']
];
我正在运行一个搜索以获得结果。我需要使用表达式,因为我需要在过滤器中有一个“或”。因此,在 UI 中,我构建了搜索并产生了正确的结果。我得到 7 个结果。现在在我的代码中,当我提醒搜索结果时,我得到 6,这意味着它没有执行代码的“或”部分。我似乎无法弄清楚如何使用“或”。第一次在代码中使用表达式,因此修复它可能是一件简单的事情。我已经以各种可能的方式尝试了括号。有没有人有任何解决方案?提前致谢!
【问题讨论】:
-
哪一部分没有运行?包含日期的部分或包含清除测试的部分?如果是日期部分,您实际上在预期字段中有日期吗?
-
清仓部分未运行。 or 之前的一切都运行良好。我得到 6 个结果,这是正确的。应该是包括清除在内的总共 7 个结果。使用上面的代码,我得到 6 个结果。所以它没有看到最终的清仓返利项目。但在 UI 中我得到 7。
-
语法上看起来是正确的。我很想看看您在 UI 中设置的搜索过滤器以及您在 UI 中期望的结果。
标签: filter expression netsuite suitescript