如何在NetSuite Suitelet中搜索项目自定义字段

时间:2014-02-27 01:50:11

标签: javascript scripting netsuite

正如标题所说,我正在尝试按自定义字段创建按件搜索项目。但有问题。 错误表示无效的过滤器或ID。

function main(request, response) {

var search_filters = new Array();
search_filters[0] = new nlobjSearchFilter('custitem_itemcategory', null, 'is','Add-on Items');

var search_columns = new Array();
search_columns[0] = new nlobjSearchColumn('itemid');
search_columns[1] = new nlobjSearchColumn('displayname');
search_columns[2] = new nlobjSearchColumn('storedisplayname');
search_columns[3] = new nlobjSearchColumn('storedescription');
search_columns[4] = new nlobjSearchColumn('storedetaileddescription');
search_columns[5] = new nlobjSearchColumn('storedisplayimage');
search_columns[6] = new nlobjSearchColumn('storedisplaythumbnail');
search_columns[7] = new nlobjSearchColumn('onlineprice');
search_columns[8] = new nlobjSearchColumn('outofstockmessage');

var search_item_list = nlapiSearchRecord('item',null,search_filters,search_columns);

response.setContentType('JSON');
response.write(JSON.stringify({'addonitems':search_item_list}));
}

其中,项目自定义字段“custitem_itemcategory”是多选类型。

1 个答案:

答案 0 :(得分:0)

使用'anyof'而不是'is',然后指定custitem_itemcategory的internalId。