SDF Adds Life-cycle Hooks Framework Starting with BeforeUndeploy
SuiteCloud Development Framework now supports life-cycle hooks in SuiteApp projects, starting with a BeforeUndeploy hook that executes custom SuiteScript logic before uninstallation. The framework is designed for additional hook points in future releases.
What changed
SDF introduces a life-cycle hooks framework that lets developers attach custom SuiteScript logic to specific moments in a SuiteApp's life-cycle. Hooks are declared in the application.xml manifest and must reference SuiteScript files with the sdf-installation-script script type.
Currently only one hook is available:
BeforeUndeploy— fires immediately before the SuiteApp is uninstalled. Use it for cleanup tasks such as archiving data, revoking integrations, deleting orphaned custom records, or notifying external systems.
Limitations
- Hooks are SuiteApp-only. Account Customization Projects (ACP) do not support them.
- The framework currently ships a single hook. Oracle states the design is “for expansion” with additional hooks (e.g., AfterInstall, BeforeUpdate) expected in future releases, but no timeline is given.
- The source does not specify governance limits or execution-time caps for hook scripts. Verify these in your target environment before relying on long-running logic.
How it works
In your SuiteApp project’s application.xml, add a hook entry referencing a script of type sdf-installation-script:
<hooks>
<hook type="BeforeUndeploy" filename="SuiteScripts/before_undeploy.js" />
</hooks>
Note: The exact XML schema is not fully documented in this source. Confirm the element names and nesting against the SDF XML Reference for your NetSuite version before deploying.
What to do
- Identify SuiteApps that need pre-uninstall cleanup. If you currently rely on manual steps or workarounds when removing a SuiteApp, this hook can automate that logic.
- Create an
sdf-installation-scriptcontaining yourBeforeUndeploylogic. This is the same script type used by existing SDF installation scripts — review Customizing SuiteApp Project Deployment using SDF Installation Scripts in the NetSuite Help Center for the entry-point function signatures. - Register the hook in
application.xmlby adding the appropriate hook element pointing to your script file. - Test in a Sandbox account. Because the hook fires during uninstall, a failed script could block SuiteApp removal. Validate error handling, governance usage, and idempotency before promoting to production.
- Watch for additional hooks in upcoming releases. If you currently use SDF installation scripts for post-install or pre-update tasks, those may eventually migrate to dedicated hook types.
Source: Oracle NetSuite Release Notes