RE: How to update a record using external id through NetSuite Restlet?


I have a record and I have set a value in external id at the time of record creation. Now want to update that record using that external id. How can I do this in restlet?



Titu Singh

Titu Beginner Asked on September 2, 2021 in SuiteScript.
Add Comment
13 Answers

I am doing the same but did not get success.


function getRecordId(datain) {
var a_filter = [];
var a_column = [];
a_filter.push(new nlobjSearchFilter(‘externalid’, null, ‘is’, datain.loanid));
a_column.push(new nlobjSearchColumn(‘internalid’));
var o_record_search = nlapiSearchRecord(‘customrecord_aggregator_sale’, null, a_filter, a_column);
if (o_record_search) {
i_record_id = o_record_search[0].getId();
nlapiLogExecution(‘DEBUG’, recordid + ‘ >>>’, i_record_id);
return i_record_id;

function update_sale(datain, i_record_id) {
var rec = nlapiLoadRecord(‘customrecord_aggregator_sale’, i_record_id);
rec.setFieldValue(‘custrecord_as_state’, datain.state);

Beginner Answered on September 7, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.