ANS-0436 · SUITESCRIPT DEVELOPMENT
How to Resolve ‘Unexpected Error on Save’ in NetSuite Scripted Record Forms
Learn how to troubleshoot and resolve the 'Unexpected Error on save' message encountered when managing scripts on NetSuite's Scripted Record forms by adjusting script deployments.
Short answer
The 'Unexpected Error on save' in NetSuite Scripted Record forms often occurs when multiple scripts are deployed to '-All Records-'. To resolve this, temporarily undeploy these scripts and change their 'Applies to' setting. This allows reordering and saving changes. Afterward, redeploy the scripts to their original settings.
Scenario
Users may encounter an 'Unexpected Error on save' message when attempting to save changes within a NetSuite Scripted Record form. This issue is a known problem, typically arising when multiple scripts are deployed with the 'Applies to' field set to '-All Records-'.
Solution
Identify the scripts deployed with the 'Applies to' field set to '-All Records-'. These are often the cause of the 'Unexpected Error on save'.
For each identified script deployment, temporarily undeploy it by unchecking the 'Deployed' checkbox.
Change the 'Applies to' field for these temporarily undeployed scripts to a different value. This action ensures they no longer appear in the list on the Scripted Record form.
Navigate back to the Scripted Record form. With the conflicting scripts no longer present, reorder the remaining scripts as needed and save the changes. The 'Unexpected Error' should no longer occur.
After successfully saving the changes, revert the modifications made in steps 2 and
Redeploy the scripts by rechecking the 'Deployed' checkbox and setting their 'Applies to' field back to their original configuration of '-All Records-'.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
