What are you building that requires this functionality? What are you trying to accomplish?
To answer your specific question, you can do a search once to retrieve all elements of the `customerstatus` list:
Code:
var results = nlapiSearchRecord(“customerstatus”, null, null, [new nlobjSearchColumn(“name”)]);
You can then get the ID or the names of each element from there. For instance, if I wanted to generate a list of all the possible status names:
Code:
function toName(result) {
return result.getValue(“name”);
}
var names = results.map(toName);
In my environment, `names` is now:
Code:
[
“Closed Lost”,
“Closed Won”,
“Dead”,
“Identified Decision Makers”,
“In Discussion”,
“In Negotiation”,
“Lost Customer”,
“New”,
“Opportunity Identified”,
“Proposal”,
“Purchasing”,
“Qualified”,
“Renewal”
]