1
searchResultSet.columns.length - > undefined ....** SuiteScript 2.0 **在客户端脚本中创建搜索对象时出错
此代码缺少什么?
功能pageInit(ScriptContext中){
try{
var currentRecord = scriptContext.currentRecord;
var searchObj = search.load({
id:'customsearchvc_bt_duplicate_vendor_list'
});
var searchResultSet=searchObj.run();
var noOfDupVendors = searchResultSet.length;
log.debug({details: "there are "+searchResultSet.columns.length+" duplicate vendors"});
currentRecord.setText({
fieldId: 'custrecordvc_merge_vendor_total_unique_v',
text: noOfDupVendors
});
}catch(e){
log.error("error at getinputdata stage","error detail is :"+e.message);
}
尽管我的答案,一个很好的方法来完成摹您共享的代码实际上是一个动态字段,其结果来自摘要式搜索。不需要SuiteScript。查看Netsuite帮助以获取更多信息:使用摘要搜索结果导出的值创建自定义字段。 –