When using currentRecord API, after I make a chang...
# suitescript
d
When using currentRecord API, after I make a change how do I commit that change to the model? I am trying to remove a dependency from a record in preparation to delete it, however, even if I set the value of the field to null it still throws a exception when trying to delete the child record.
Copy code
scaleRecord.setValue({fieldId: 'custrecord_mro_scale_scale_currentreadin', value:null});
    resultSet.each(function(result){
      record.delete({type: 'customrecord_mro_scale_scalereading', id: result.getValue('id')})
      return true;
    });
Solution is… it can’t be done when using the currentRecord API, you have to use currentRecord to use record.load
…..lame
s
currentRecord
is immutable IIRC
s
If you're wanting to reference the current record, you can use currentRecord.get().
var currentRec = currentRecord.get()
then you can use that object to set values.