title: NetSuite - get Line Item ID
body: <p>I have a scenario like this: System A creates invoices with line items and pushes into NetSuite. It's possible, later, the invoice in System A has been modified where line items are either updated or removed and pushed back into NetSuite. How would we know what line items have been modified or removed? Should System A send back a line id? In that case I am trying to work out how to obtain line item Id but it's not returning a value.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>for (var x = 1; x &lt;= itemcount; x++)
   {
   var lineid = nlapiGetLineItemValue('item', 'linenumber', x)
   nlapiLogExecution('DEBUG', 'removing  =  ', lineid);
    if(lineid == 1)
    {
              nlapiLogExecution('DEBUG', 'removing line item 1');
     nlapiRemoveLineItem('item', x)
    }
   }</code></pre>
  </div>
  </div>
  </p>