简体   繁体   English

无法从netsuite中保存的搜索中检索自定义列表值

[英]Unable to retrieve custom list value from saved search in netsuite

Creating saved search in suitescript using nlapiSearchRecord. 使用nlapiSearchRecord在suitescript中创建已保存的搜索。 All the column value returns except one column which is type is custom list. 除了一列类型是自定义列表之外,所有列值都返回。 How could I get value of custom list? 我怎样才能获得自定义列表的价值?

To get the value I'm using code lines below. 为了获得值,我正在使用下面的代码行。

columns[0] = new nlobjSearchColumn( 'customlist' );
 var searchresults = nlapiSearchRecord( 'customrecord', null, filters, columns );

To get the column value 获取列值

var  listValue = searchresult.getListValue( 'customlist' );

I assume you've simplified your code in trying to be clear or confidential but there will never be fields or records with those ids. 我假设你已经简化了你的代码,试图保持清晰或保密,但永远不会有那些带有这些id的字段或记录。

from a search you would do: 从你会做的搜索:

var searchResult = searchResults[0];
searchResult.getValue(fieldId, joinName, summary)
// or in your case
searchResult.getValue('customlist'); //returns id of list value or simple result of non-list/record fields

or (and I think this is the one you want) 或者(我认为这是你想要的)

searchResult.getText('customlist'); // returns the display value of the list/record field. 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM