简体   繁体   English

如何在 NetSuite RESTlet 中创建具有“不等于”条件的搜索过滤器表达式?

[英]How to create a search filter expression with a 'not equal to' condition in a NetSuite RESTlet?

I'm new to JavaScript and to NetSuite as well.我是 JavaScript 和 NetSuite 的新手。 I'm trying to create a search with filters expressions but NetSuite is throwing an error in the condition 'not equal to'.我正在尝试使用过滤器表达式创建搜索,但 NetSuite 在“不等于”条件下抛出错误。 This is my code:这是我的代码:

           search
            .create({
              type: search.Type.JOB,
              filters: [
                [
                  "externalid",
                  search.Operator.IS,
                  childProject.ClassExternalId,
                ],
                "and",
                ["parent", search.Operator.NOTEQUALTO, 142],
              ],
              columns: ["externalid"],
            })

Script Execution Log脚本执行日志

Title: SSS_INVALID_SRCH_OPERATOR标题:SSS_INVALID_SRCH_OPERATOR

Detail: An nlobjSearchFilter contains an invalid operator, or is not in proper syntax: parent.详细信息:nlobjSearchFilter 包含无效的运算符,或者语法不正确:父级。

I've also tried this with the same result: ["parent", search.Operator.ISNOT, 142]我也试过这个,结果相同:[“parent”,search.Operator.ISNOT,142]

So my question is:所以我的问题是:

How do I tell NetSuite to search 'jobs' with 'externalid' === childProject.ClassExternalId and 'parent' !== 142?如何告诉 NetSuite 使用“externalid”=== childProject.ClassExternalId 和“parent”搜索“jobs”!== 142?

Thanks谢谢

Parent field would be a record / list type.父字段将是记录/列表类型。

Try using "NONE OF" operator in the filter for Parent field.尝试在父字段的过滤器中使用“NONE OF”运算符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM