Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Can't update a custom record
Hi,
I’m trying to search for a particular customer record and then update it with some field values.
This occurs after an item record is created and the record is saved.
Please refer to the following code:
function afterSaveBillingRate(type)
{
var newRecord = nlapiGetNewRecord();
var project = newRecord.getFieldValue('custitempr');
var filters = new Array();
filters[0] = new nlobjSearchFilter( 'altname', null, 'equalTo', project, null );
var columns = new Array();
columns[0] = new nlobjSearchColumn( 'custrecordbilling_rate' );
var searchresults = nlapiSearchRecord('projects', null, filters, columns);
if ( type == 'create' )
{
var record = nlapiLoadRecord(searchresults[ 0 ].getRecordType() , searchresults[0].getID() );
record.setFieldValue('custrecordbilling_rate', project);
nlapiSubmitRecord(record);
}
}
I get an unexpected error message: