ANS-0284 · SUITESCRIPT DEVELOPMENT
How to Prevent ‘Page Modified’ Warnings with Custom Suitelet Submit Buttons
When implementing custom submit buttons in NetSuite Suitelets, users may encounter unexpected 'page modified' warnings that can disrupt the workflow.
Short answer
To prevent the "page modified" warning when using a custom submit button in a NetSuite Suitelet, it is necessary to programmatically reset the page's modification status. This ensures the system does not prompt the user about unsaved changes, allowing for a seamless submission or navigation experience.
Scenario
Users interacting with a custom Suitelet that includes a custom submit button may experience an "Are you sure you want to leave this page?" warning. This occurs even after the custom button is clicked, as the system perceives unsaved changes, potentially hindering the intended programmatic submission or navigation.
Solution
To prevent the "page modified" warning when a custom submit button is used in a Suitelet, it is necessary to programmatically "trick" the page into believing it has not been modified. This action ensures the system does not prompt the user with an "Are you sure you want to leave?" message.This is typically achieved by manipulating the page's Document Object Model (DOM) to reset its modification status. While the exact DOM property or method required for this can vary and may depend on the NetSuite version, the general approach involves setting a property that indicates the page has no unsaved changes. This prevents the warning from appearing and allows the custom submit action to proceed seamlessly.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
