筛选已保存的搜索套件脚本

huangapple go评论62阅读模式
英文:

filter on saved search suitescript

问题

我想在保存的搜索上设置一个筛选条件,即如果我按下复选框(复选框 == T),它将显示发票中的所有项目,前提是一个项目包含在项目中。例如,我选择了项目 A01,在目标发票上,即发票 INV 001 包含项目(A09、A08 和 A07),发票 INV 002(A01、A02 和 A03),那么结果将是 INV 002,其中包含所有项目(因为我们在筛选中选择了 A01)。

if (checkbox === true) {
    if (itemId[0] != "") {
        filter.push(
            "AND",
            ["item", "anyof", "item"])
    }
}
else {
    if (itemId[0] != "") {
        filter.push(
            "AND",
            ["item", "anyof", itemId])
    }
}

在这里,只有当复选框为 true 时,我才显示所有项目,并显示所有内容。如何正确拦截呢?

英文:

I want to make a filter on saved search with the condition that if I press the checkbox (checkbox == T) it will display all items in the invoice provided that one item is included in the item. for example I chose item A01, and on the target invoice, namely invoice INV 001 containing items (A09, A08, and A07) and invoice INV 002 (A01, A02, A03) then the result that will come out is INV 002 with all the items available (because we choose in filter A01)

if (checkbox === true) {
    if (itemId[0] != "") {

        filter.push(
            "AND",
            ["item", "anyof", "item"])
    }
}
else {
    if (itemId[0] != "") {

        filter.push(
            "AND",
            ["item", "anyof", itemId])
    }
}

here I only show all items if the checkbox is true, and displays everything. what is the appropriate way of intercepting?

答案1

得分: 1

筛选条件是 anylineitem

所以

filter.push('AND', ['anylineitem', 'is', itemId])
英文:

The filter for this is anylineitem

so

filter.push('AND', ['anylineitem', 'is', itemId])

huangapple
  • 本文由 发表于 2023年5月29日 12:18:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76354649.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定