How to set any record fields through console using Suitescript

We can set any record fields using the internal id of the record, the internal id of the field, and the record.submitFields() from the ‘N/record’ module. Please refer to the following:

require(['N/record'], function(record) {       
record.submitFields({                             
type: <REC_TYPE>,                             
id: <REC_INTERNAL_ID>,                             
values: {    <FIELD_ID> : <VALUE> },                             
options: {                                 
enableSourcing: false,                                 
ignoreMandatoryFields : true                             
}                         
});     
});

Leave a comment

Your email address will not be published. Required fields are marked *