Netsuite: how to edit or update a record?

I am new to NetSuite scripts. It appears that the normal EDIT or UPDATE function is not at all normal in Netsuite. There are APIs for creating and deleting records of type nlapiCreateRecordand nlapiDeleteRecord, but nowhere in the documentation could I find a way to edit and update an existing record. I have restrictions on using PHP.

I created a custom TFC user form (js server side) that should be able to retrieve data and update if necessary. I managed to get the records at the moment, but please tell me how to update an existing record?

+3
source share
3 answers

, nlapiLoadRecord . . nlapiSubmitRecord, .

:

var record = nlapiLoadRecord('record_type_goes_here', internal_id_of_record_goes_here);
record.setFieldValue('field_internal_id_goes_here', 'value to set goes here);
nlapiSubmitRecord(record);

, .

+7
+1

In the interest of anyone looking at this issue that is related to performance, it’s much more efficient to use

nlapiSubmitField(type, id, fields, values, doSourcing)

If you know for sure that you are updating. This is faster than submitRecord, and avoids significant overhead when you first load a record.

0
source

All Articles