title: How do you get a list of all available list values for a field in NetSuite?
body: <p>I would like to set a value into a list field in NetSuite, but I am finding that I receive an error if that value does not exist. </p>
  
  <p><strong>How can I search for all values to check if the value I am trying to place is good or not? I would also be open to this just failing silently without showing an error and instead just not populating the value.</strong></p>
  
  <blockquote>
    <p>ERROR_CODE:INVALID_KEY_OR_REF MESSAGE:Invalid custentity_esc_industry
    reference key Wholesale. STATUS_TYPE: ERROR</p>
  </blockquote>
  
  <pre><code>try {
    //var rec = scriptContext.newRecord;
    var integrationFieldValue = scriptContext.newRecord.getValue(integrationFieldName);
    if(integrationFieldValue != null &amp;&amp; integrationFieldValue != ''){
      scriptContext.newRecord.setText({
        fieldId: actualFieldName,
        text: integrationFieldValue
      });
    }
  } catch(e){
    log.error({
      title: "setNonIntegrationFieldValue() has encountered an error.",
      details: e.message
    });
  }
  </code></pre>