title: Validate In-Line Edits in Netsuite
body: <p>I need to validate inline editing in NetSuite. </p>
  
  <p>I already have a Client Script in place that works great when editing the record normally. </p>
  
  <p>I tried adding a User Event script that on the before save function that validates the record, but it appears this is ignored with inline editing. </p>
  
  <p>Has anybody ran into this before?</p>
  
  <p>Any insight you can provide would be helpful. Thanks!</p>
  
  <p>Edits:</p>
  
  <p>The relevant code from the UE script:</p>
  
  <pre><code>function beforeSubmit(type){
      if (type == "create" || type == "edit" || type == "xedit") {
          var status = nlapiGetContext().getSetting("SCRIPT", "...");
          var amount = Number(nlapiGetContext().getSetting("SCRIPT", "..."));
  
          var nr = nlapiGetNewRecord();
          var entitystatus = nr.getFieldValue("entitystatus");
          var projectedtotal = Number(nr.getFieldValue("projectedtotal"));
          if (entitystatus == status &amp;&amp; projectedtotal &gt;= amount) {
              var statusText = nr.getFieldText("entitystatus");
              var message = "ERROR...";
              throw nlapiCreateError("...", message, true);
          }
      }
  }
  </code></pre>
  
  <p>This applies to the opportunity record.</p>
  
  <p>The field being validated is Projected Total with id <code>projectedtotal</code>.</p>