title: Netsuite: Manually modify [invoiced] field in Sales Order > Item subtab
body: <p>Is there any way to manually modify [invoiced] field in Sales Order > Item subtab via SuiteScript? </p>
  
  <p>Currently I am able to update this field via nlapiTransformRecord(sales order to invoice), but in case there are two item fulfillment for same item, I do not want to combine these together instead I want to show two rows in Invoice. I am able to achieve this by using SelectNewLineItem but the problem is the [invoiced] field is not being updated. Please help. Thanks.</p>
  
  <p>As show in below, if I use SelectLineItem it works perfectly. But SelectNewLineItem somehow failed to update the [invoiced] field.</p>
  
  <pre><code>var newrecords = nlapiTransformRecord('salesorder', results[0][9],
              'invoice', {
                  recordmode : 'dynamic'
              });
  
  //Temporary hardcoded this to 2 for testing
  if (m == 2) {
              newrecords.selectNewLineItem('item');
              newrecords.setCurrentLineItemValue('item', 'item',
                      results[m][10]);
              newrecords.setCurrentLineItemValue('item', 'quantity',
                      results[m][4]);
              newrecords.setCurrentLineItemValue('item', 'amount',
                      results[m][5]);
              newrecords.commitLineItem('item');
  
          } else {
              var lineNum = newrecords.findLineItemValue('item', 'item',
                      results[m][10]);
              newrecords.selectLineItem('item', lineNum);
              newrecords.setCurrentLineItemValue('item', 'item',
                      results[m][10]);
              newrecords.setCurrentLineItemValue('item', 'quantity',
                      results[m][4]);
              newrecords.setCurrentLineItemValue('item', 'amount',
                      results[m][5]);
              newrecords.commitLineItem('item');
          }
      }
      nlapiSubmitRecord(newrecords, false, true);}
  </code></pre>