Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
help me with the following code
function myBeforeLoad( type, form )
{
nlapiLogExecution( 'DEBUG', 'test userevent:beforeload', 'entry of this function' );
if( type == 'create')
{
nlapiLogExecution( 'DEBUG', 'create', 'in create subbranch' );
}
else if( type == 'view' )
{
nlapiLogExecution( 'DEBUG', 'view', 'in view subbranch' );
var oldrecord = nlapiGetOldRecord();
var newrecord = nlapiGetNewRecord();
// nlapiLogExecution( 'DEBUG', 'oldrecord content', oldrecord.getRecordType() + " and " + oldrecord.getId() );
// nlapiLogExecution( 'DEBUG', 'newrecord content', newrecord.getRecordType() + " and " + newrecord.getId() );
if( oldrecord == newrecord )
nlapiLogExecution( 'DEBUG', 'comparison', 'new equals to old' );
var type = nlapiGetRecordType();
var id = nlapiGetRecordId();
nlapiLogExecution( 'DEBUG', 'direct get content', type + " and " + id );
}
else if( type == 'edit' )
{
nlapiLogExecution( 'DEBUG', 'edit', 'in edit subbranch' );
}
}
as the highlighted part, newrecord is the one returned by the server, however, oldrecord is null. how did it come about? as for the blue part, the method getRecordType() could not be executed. why?