答案 0 :(得分:1)
是的,您可以创建已保存搜索的搜索。您可以在浏览器控制台中运行以下命令进行测试,然后根据需要进行修改:
require(['N/search'], function (search) {
var savedSearches = search.create({
type: search.Type.SAVED_SEARCH,
filters: [
['recordtype','is','Transaction']
],
columns: [
search.createColumn({
name: 'id'
}),
search.createColumn({
name: 'title'
}),
search.createColumn({
name: 'recordtype'
})
]
});
savedSearches.run().each(
function(r) {
var a = r.getValue({
name:'id'
});
var b = r.getValue({
name:'title'
});
var c = r.getValue({
name:'recordtype'
});
console.log(a + ' | ' + b + ' | ' + c);
return true;
}
);
});