This notification to inform you of a change to the behavior of the CurrentRecord.getSubrecord method, to be implemented in NetSuite 2021.1. This change will impact existing scripts that include this method. Before your account is upgraded to NetSuite 2021.1, you should review these scripts and make changes as needed to avoid unexpected results.
What Is Changing?
Currently, if a script uses the CurrentRecord.getSubrecord to get a subrecord that does not exist, null is returned. This method may be used to check whether a record has an existing subrecord.
As of the NetSuite release 2021.1, if a script uses the CurrentRecord.getSubrecord to get a subrecord that does not exist, a new subrecord will be created and returned. With this change in behavior, it will no longer be possible to use this method to check whether a record has an existing subrecord.
The following code snippet demonstrates the current behavior:
var addressRec = currentRec.getSubrecord({
fieldId: 'shippingaddress'
});
if (!addressRec)
// Check if the field contains a subrecord.
// This will not work after API change.
return false;
// If the subrecord does not exist, null is returned.
As of NetSuite release 2021.1, code like this snippet will result in the creation of a new subrecord if there is no existing subrecord.
Recommended Actions:
Review your existing scripts to find any that use the CurrentRecord.getSubrecord method to determine whether there is an existing subrecord. Before your account is upgraded to NetSuite 2021.1, update these scripts to use the CurrentRecord.hasSubrecord method instead. For more information, see the CurrentRecord.getSubrecord API topic in the NetSuite Help Center, or in SuiteAnswers (Answer ID: 51520).
If you require assistance or more information, please contact NetSuite Customer Support.