RE: How to update a record using external id through NetSuite Restlet?
Hi,
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?
Regards
Titu Singh
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);