博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SuiteScript 2.0 Error: SSS_INVALID_SRCH_FILTER_EXPR_TYPE
阅读量:5308 次
发布时间:2019-06-14

本文共 1813 字,大约阅读时间需要 6 分钟。

Issue: a search throw error SSS_INVALID_SRCH_FILTER_EXPR_TYPE 

Malformed search filter expression, first two elements must be strings. 

 

Sample code that causing error: 

var strFormulaNumeric = 'CASE {custrecord_abc_id}';    for (var i = 0; i < this.arrPriceTblId.length; i++) {     strFormulaNumeric += ' WHEN \'' + this.arrPriceTblId[i]       + '\' THEN ' + (i + 1);    }    strFormulaNumeric += ' ELSE 0 END';...var arrColumns = [];...    arrColumns.push(search.createColumn({     name : 'formulanumeric',     formula : strFormulaNumeric,     sort : search.Sort.DESC    }));...var strFormulaFilter = 'formulanumeric:' + strFormulaNumeric;var arrFilters = [                        [ 'isinactive', 'is', 'F' ],                        'AND',                        [ strFormulaFilter,                                search.Operator.GREATERTHAN, 0 ] ];...

 

Solution:

var arrFilters = [                        [ 'isinactive', 'is', 'F' ],                        'AND',                        [ String(strFormulaFilter),                                search.Operator.GREATERTHAN, 0 ] ];

We convert strFormulaFilter to a string again in JS, that works great :)

 

Great Idea:

When we have formula in the column, we sort it well; it's the best way to roll out data as specific reqirement;  works perfect :-)

 

Thanks site: 

Notes from: 

My best guess is that the Rhino interpreter parses string concatenation expressions into different Java classes than string literals/variables. The NetSuite API then fails to consider those classes when validating that an argument is a javascript “string”.

https://netsuitehub.com/forums/reply/re-record-getvalue-errors-if-field-name-is-built-programatically-5/

https://www.flowinglink.com/suitescript-2-0-sss_invalid_srch_filter_expr_type/

 

转载于:https://www.cnblogs.com/backuper/p/10562675.html

你可能感兴趣的文章
简单【用户输入验证】
查看>>
python tkinter GUI绘制,以及点击更新显示图片
查看>>
CS0103: The name ‘Scripts’ does not exist in the current context解决方法
查看>>
20130330java基础学习笔记-语句_for循环嵌套练习2
查看>>
Spring面试题
查看>>
窥视SP2010--第一章节--SP2010开发者路线图
查看>>
C语言栈的实现
查看>>
代码为什么需要重构
查看>>
TC SRM 593 DIV1 250
查看>>
SRM 628 DIV2
查看>>
2018-2019-2 20165314『网络对抗技术』Exp5:MSF基础应用
查看>>
Python-S9-Day127-Scrapy爬虫框架2
查看>>
SecureCRT的使用方法和技巧(详细使用教程)
查看>>
右侧导航栏(动态添加数据到list)
查看>>
81、iOS本地推送与远程推送详解
查看>>
虚拟DOM
查看>>
自建数据源(RSO2)、及数据源增强
查看>>
关于View控件中的Context选择
查看>>
2018icpc徐州OnlineA Hard to prepare
查看>>
Spark的启动进程详解
查看>>