Search code examples
javascriptdatabasepersistencenetsuitesuitescript2.0

How to just update some line item without saving a whole record on NetSuite?


We have a PO with 300 items lines.

And we usually use as follows to save record:

 record.save()

Is it possible to just update the updated fields to new record?

For example, the price of the item in line #10 is changed from 23 to 30, could we just update the value of the item to make the save duration shorter?


Solution

  • To update line items, the record needs to be loaded with record.load and saved with record.save. Body fields can be updated using record.submitFields which doesn't require loading and saving the whole record.

    You'll need to continue to load the whole record.