1
votes

Creating saved search in suitescript using nlapiSearchRecord. 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' );
1

1 Answers

3
votes

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.

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.