[英]How to search cases by CompanyId in Netsuite Suitescript 2.0?
I can able to search the case by company name我可以通过公司名称搜索案例
var mySearch = search.create({
type: search.Type.SUPPORT_CASE,
columns: [{
name: 'title'
}, {
name: 'company'
}],
filters: [{
name: 'company',
operator: 'is',
values: 'Test'
}]
});
return mySearch.run({
ld: mySearch.id
}).getRange({
start: 0,
end: 1000
});
But I am not able to search case by company id.但我无法通过公司 ID 搜索案例。 companyId is 115公司 ID 为 115
Below are not working下面不工作
i)一世)
filters: [{
name: 'company',
operator: 'is',
values: 115
}]
ii) ii)
filters: [{
name: 'companyid',
operator: 'is',
values: 115
}]
According to the Case schema company
is a Text filter, meaning you would have to provide it with the precise Name of the company, not the internal ID.根据案例模式, company
是一个文本过滤器,这意味着您必须为其提供公司的准确名称,而不是内部 ID。
Instead you may want to use the customer.internalid
joined filter to provide the internal ID.相反,您可能希望使用customer.internalid
加入过滤器来提供内部 ID。 Also, Internal ID fields are nearly always Select fields, meaning they do not accept the is
operator, but instead require the anyof
or noneof
operator.此外,内部 ID 字段几乎总是 Select 字段,这意味着它们不接受is
运算符,而是需要anyof
或noneof
运算符。
You can find the valid operators by field type on the Help page titled Search Operators
您可以在标题为“ Search Operators
”的“帮助”页面上按字段类型查找有效运算Search Operators
First, you can try this :首先,你可以试试这个:
var supportcaseSearchObj = search.create({
type: "supportcase",
filters:
[
["company.internalid","anyof","100"]
],
columns:
[
search.createColumn({
name: "casenumber",
sort: search.Sort.ASC
}),
"title",
"company",
"contact",
"stage",
"status",
"profile",
"startdate",
"createddate",
"category",
"assigned",
"priority"
]
});
Second : how did I get this ?第二:我是怎么得到这个的? The answer is hint that will make your life easier :答案是暗示会让你的生活更轻松:
If you can not install the chrome plugin :如果您无法安装 chrome 插件:
[loadedesearchVar].filters
添加 log.debug 以显示[loadedesearchVar].filters
Good luck!祝你好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.