Hi there, I have a Suitelet (UI) written in API 1...
# suitescript
n
Hi there, I have a Suitelet (UI) written in API 1.0 creating a form with 3 select fields (among others fieds). I am trying to dynamically populate the list in Field 3 based on a saved search where fields 1 & 2 are criteria. The search is made in another suitelet and I receive the results correctly back into the client script on Field 2 update, but I can't populate the options for field 3. Here is the snippet:
Copy code
fld = nlapiGetField("custpage_service_type");
console.log("fld", fld);
console.log("results_services.length", results_services.length);

// Add the new options to Field 'custpage_service_type'
fld.addSelectOption('', ''); // Add an empty option as the default value.
for (var i = 0; i < results_services.length; i++) {
  fld.addSelectOption(results_services[i].id, results_services[i].text);
}
b
probably start with filling a set of hardcoded select options before moving to the dynamically generated ones
if that fails, you messed up on creating the field
n
What is "results_services", an array of search results or other objects?
n
I just needed to use map 🙊