title: Update Custom Address Field in Netsuite using SuiteScript 2.0
body: <p>I created a new custom field in the 'US' address form called 'email', so I can have an email address associated with both the bill to and ship to on a sales order in Netsuite. I am trying to update this field using Suitescript 2.0, but cannot seem to save the changes. Can anyone give any insight?</p>
  
  <pre><code>var salesorder = record.load({
      type: record.Type.SALES_ORDER, 
      isDynamic: true,
      id: 6835
  });
  
  var shippingAddressSubrecord = salesorder.getSubrecord({fieldId : 'shippingaddress'});
  var email = shippingAddressSubrecord.getValue({fieldId : 'custrecord_email_address' }); //returns correctly
  shippingAddressSubrecord.setValue({fieldId : 'custrecord_email_address', value: 'test2@gmail.com', ignoreFieldChange: true });
  
  var salesorderid = salesorder.save({enableSourcing: true, ignoreMandatoryFields: true});
  </code></pre>
  
  <p>This gives the error: "type":"error.SuiteScriptError","name":"OPERATION_IS_NOT_ALLOWED","message":"The subrecord line has already been committed or cancelled. The previous subrecord reference is no longer valid. You must get another reference to the subrecord in order to perform this operation.",</p>