来自网络商店的销售订单的 Netsuite 2.0 搜索过滤器
Netsuite 2.0 Serch filter for SalesOrders that are from WEB store
尝试获取从 SCA(Suite commerce advanced)制作的销售订单,这是我的代码。
var type = searchModule.Type.SALES_ORDER;
var columns = [];
var filters = [];
columns = _.concat(columns, [
searchModule.createColumn({
name: 'internalid'
}),
searchModule.createColumn({
name: 'tranid'
})
]);
filters = _.concat(filters, [
searchModule.createFilter({
name: 'status',
operator: searchModule.Operator.IS,
values: 'SalesOrd:A'
}),
searchModule.createFilter({
name: 'mainline',
operator: searchModule.Operator.IS,
values: 'T'
}),
searchModule.createFilter({
name: 'type',
operator: searchModule.Operator.ANYOF,
values: 'SalesOrd'
}),
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.STARTSWITH,
values: 'Web'
})
]);
var mySearchObj = {type: type, filters: filters, columns: columns};
// uncomment for test use
/*
log.debug({title: 'type', details: type});
log.debug({title: 'columns', details: columns});
log.debug({title: 'filters', details: filters});
*/
var searchItems = searchModule.create(mySearchObj).run().getRange({start: 0, end: 999});
ordersList = [];
过滤器不起作用
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.STARTSWITH,
values: 'Web'
})
它有任何方法可以使这项工作,我也尝试使用 CONTAINS,但同样的问题没有解决。启动和 SC 例外。
source
过滤器的字段类型为 Select
,这意味着您不能在其上使用文本运算符。您可以使用的唯一运算符是 ANYOF
和 NONEOF
。您需要找到源的 SCA 值的内部 ID,并将其用于您的过滤器值。
我不确定在哪里可以找到该 ID,但您可以通过加载在其来源字段中设置了适当值的销售订单并使用 getValue()
查看该值是什么来找到它。
您应该使用 ANYOF
作为运算符而不是 STARTSWITH
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.ANYOF,
values: ['WebStore Name']
})
这里是使用源字段作为过滤器的有效保存搜索的摘录。
{
"name":"source",
"join":null,
"operator":"anyof",
"values":[
"NLWebStore"
],
"formula":null,
"summarytype":null,
"isor":false,
"isnot":false,
"leftparens":0,
"rightparens":0
}
尝试获取从 SCA(Suite commerce advanced)制作的销售订单,这是我的代码。
var type = searchModule.Type.SALES_ORDER;
var columns = [];
var filters = [];
columns = _.concat(columns, [
searchModule.createColumn({
name: 'internalid'
}),
searchModule.createColumn({
name: 'tranid'
})
]);
filters = _.concat(filters, [
searchModule.createFilter({
name: 'status',
operator: searchModule.Operator.IS,
values: 'SalesOrd:A'
}),
searchModule.createFilter({
name: 'mainline',
operator: searchModule.Operator.IS,
values: 'T'
}),
searchModule.createFilter({
name: 'type',
operator: searchModule.Operator.ANYOF,
values: 'SalesOrd'
}),
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.STARTSWITH,
values: 'Web'
})
]);
var mySearchObj = {type: type, filters: filters, columns: columns};
// uncomment for test use
/*
log.debug({title: 'type', details: type});
log.debug({title: 'columns', details: columns});
log.debug({title: 'filters', details: filters});
*/
var searchItems = searchModule.create(mySearchObj).run().getRange({start: 0, end: 999});
ordersList = [];
过滤器不起作用
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.STARTSWITH,
values: 'Web'
})
它有任何方法可以使这项工作,我也尝试使用 CONTAINS,但同样的问题没有解决。启动和 SC 例外。
source
过滤器的字段类型为 Select
,这意味着您不能在其上使用文本运算符。您可以使用的唯一运算符是 ANYOF
和 NONEOF
。您需要找到源的 SCA 值的内部 ID,并将其用于您的过滤器值。
我不确定在哪里可以找到该 ID,但您可以通过加载在其来源字段中设置了适当值的销售订单并使用 getValue()
查看该值是什么来找到它。
您应该使用 ANYOF
作为运算符而不是 STARTSWITH
searchModule.createFilter({
name: 'source',
operator: searchModule.Operator.ANYOF,
values: ['WebStore Name']
})
这里是使用源字段作为过滤器的有效保存搜索的摘录。
{
"name":"source",
"join":null,
"operator":"anyof",
"values":[
"NLWebStore"
],
"formula":null,
"summarytype":null,
"isor":false,
"isnot":false,
"leftparens":0,
"rightparens":0
}