Validating UPCs with SuiteScript in NetSuite

NetSuite's out-of-the-box UPC field (id 'upcode') is a free text field that allows up to 999 characters. For my use case, I only want the UPC field to be blank or contain 12 digits on inventory items and assembly items. This can probably be achieved via a workflow. Instead, I decided to apply a script as I am currently learning SuiteScript.

The completed script can be found on my GitHub page here.

Page Last Updated: 5/28/24