Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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: