NetSuite 保存的搜索:显示与子项目匹配的行项目,但也显示没有子项目的行项目?

NetSuite Saved Search: Showing line items that match a child item but also show line items that don't have a child?

我正在尝试显示子记录上的特定字段,但我也不想排除没有子记录的订单项,我不确定如何实现这一点...这是我尝试过的方法(但对我的交易保存搜索不起作用):

CASE {custrecord.item} WHEN {item} THEN 1 WHEN NULL THEN 1 ELSE 0 END

CASE {custrecord.item} WHEN NULL THEN NULL ELSE {custrecord.lplotnumber} END

这样做排除了没有子项的行项目,但我希望这些行只显示空白结果字段。


添加的详细信息:

这是我希望看到的示例table:

{Item} formula for {custrecord.lplotnumber} Theoretical {custrecord.item}
1234567 1234567 (this wouldn't actually exist)
2345678 LP1234567 2345678 (this would exist)
3456789 LP2345678 3456789 (this would exist)
4567891 4567891 (this wouldn't actually exist)

我希望它通过将项目与自定义记录项匹配来显示正确的 {custrecord.lplotnumber},但我不想排除没有匹配的自定义记录项的行。

这是我目前实际看到的示例 table:

{Item} {custrecord.lplotnumber} {custrecord.item}
2345678 LP1234567 2345678 (this would exist)
3456789 LP2345678 3456789 (this would exist)

它排除了没有匹配的自定义记录项的行。但是如果我不过滤我的数据,我会在每一行上得到重复的数据。

下面是一个示例,说明在没有我正在寻找的过滤器的情况下会发生什么:

{Item} {custrecord.lplotnumber} {custrecord.item}
1234567 1234567 (this wouldn't actually exist)
1234567 LP1234567 2345678 (this would exist)
1234567 LP2345678 3456789 (this would exist)
1234567 4567891 (this wouldn't actually exist)
2345678 1234567 (this wouldn't actually exist)
2345678 LP1234567 2345678 (this would exist)
2345678 LP2345678 3456789 (this would exist)
2345678 4567891 (this wouldn't actually exist)
3456789 1234567 (this wouldn't actually exist)
3456789 LP1234567 2345678 (this would exist)
3456789 LP2345678 3456789 (this would exist)
3456789 4567891 (this wouldn't actually exist)
4567891 1234567 (this wouldn't actually exist)
4567891 LP1234567 2345678 (this would exist)
4567891 LP2345678 3456789 (this would exist)
4567891 4567891 (this wouldn't actually exist)

如果我准确理解了你的问题,你应该根本不需要应用与子记录相关的过滤器。只需将子记录中的字段添加到您的结果中。对于存在该值的行,您应该看到该值;如果没有,该字段应为空白。

我重新创建了您在没有过滤器的情况下发生的情况的示例,并在 excel 中添加了 2 列以帮助说明解决方案。

在 excel 中,您将使用以下公式:=IF(D3=A3,B3,"")

NetSuite 保存的搜索的等价物是:CASE WHEN {item}={custrecord.item} THEN {custrecord.lplotnumber} ELSE 'Exclude' END

将该公式添加为结果列,以便您检查您的工作。如果有效,请将相同的公式添加到标准并排除 'Exclude' 个值。

如果公式中使用的字段在 null 时抛出错误,您可以用 NVL or NVL2.

包装该变量

我觉得你的公式很好。尝试将等于 1 切换为不等于 0。

您也可以试试: CASE WHEN LENGTH({custrecord.item}) > 0 AND {custrecord.item} <> {item} THEN 0 ELSE 1 END

同样,不等于 0