id = nlapiGetNewRecord().getId();
As an alternative to nlapiGetRecordId(), the line of code above is the function that should be used to get the InternalID of a newly created record.
Note: The line of code above can only be used in a UserEvent Script, and on an After Submit Function.
Code Break Down
nlapiGetNewRecord() - Returns: An nlobjRecord containing all the values being used for a write operation.
getId() - A function within the nlobjRecord object.
Returns: Integer value of the record ID