要检索包含 PO# 字段 (id: otherrefnum) 上特定文本/值的子字符串的所有记录,仅使用“nlobjSearchFilter(‘otherrefnum’, null, ‘contains’, text)”似乎不起作用。它返回所有记录,就好像没有应用过滤器一样。 使用“equalto”有效,但这将匹配 PO# 字段中的整个字段值。

解决方案是使用poastext而不是otherrefnum。 请参阅下面的示例代码。

var invoiceSearchObj = search.create({
                type: "invoice",
                filters:
                    [
                        ["type", "anyof", "CustInvc"],
                        "AND",
                        ["poastext", "contains", "ABC"], //ABC is the keyword
                        "AND",
                        ["mainline", "is", "T"]
                    ],
                columns:
                    [
                        search.createColumn({ name: "internalid", label: "Internal ID" })
                    ]
            });
            invoiceSearchObj.run().each(function (result) {
                //TODO
                return true;
            });
Last modified: 16/04/2023

Author

Comments

Write a Reply or Comment

Your email address will not be published.