beforeUndeploy Installation Hook in NetSuite 2026.1
Introducing the beforeUndeploy installation hook in NetSuite 2026.1 for custom pre-uninstall logic in SuiteApps.
TL;DR Opening
Starting in NetSuite 2026.1, the new beforeUndeploy installation hook allows developers to execute custom logic before a SuiteApp is uninstalled. This feature is crucial for ensuring that any associated data, like custom records and files, are cleanly removed, preventing potential integration issues.
What’s New
With the introduction of the beforeUndeploy hook, developers can now define specific actions that should take place right before a SuiteApp is uninstalled from a NetSuite account. This includes:
- Deleting custom records: Ensure that no orphaned records remain.
- Removing files and folders: Clean up any associated files that were created by the SuiteApp.
- Executing any necessary cleanup scripts: Enforce business logic or workflows that are tailored to the app’s uninstall process.
This hook is defined within a new configuration file, named application.xml, located in the root directory of your SuiteApp project, alongside essential files like manifest.xml and deploy.xml. Within application.xml, you can set up a <beforeUndeploy> section under the <hooks> element. Here, you can reference one or more SDF installation scripts containing the necessary logic to run during the uninstall process.
How to Implement the beforeUndeploy Hook
- Create
application.xml: Ensure this file exists at the root of your SuiteApp project. - Define the Hook: Within
application.xml, add a section like this:<hooks> <beforeUndeploy> <script>path/to/your/script.js</script> </beforeUndeploy> </hooks> - Develop Logic: Write the logic you want to run in the script referenced above, ensuring it achieves your cleanup objectives.
Who This Affects
This new feature is particularly relevant for:
- SuiteCloud Developers: Those building SuiteApps will benefit greatly from enhanced control over the uninstall process.
- Administrators: Admins managing SuiteApps will have a better understanding of potential data impacts.
- Business Analysts: Those looking to maintain clean data and records across the platform will find this tool useful.
Key Takeaways
- New beforeUndeploy Hook: This hook allows for execution of cleanup logic before a SuiteApp is uninstalled.
- Configuration in application.xml: Setup is done via a new configuration file in the SuiteApp project.
- Custom Logic Execution: You can implement logic to delete records and files associated with a SuiteApp.
- Prevents Orphaned Records: Helps maintain clean data integrity by cleaning up associated records.
- Enhanced Developer Control: Provides developers with more robust management capabilities during SuiteApp lifecycle management.
Frequently Asked Questions (4)
How do I implement the beforeUndeploy hook in my SuiteApp project?
What kind of cleanup actions can I perform with the beforeUndeploy hook?
Do I need to create any new configuration files to use the beforeUndeploy hook?
Can the beforeUndeploy hook prevent data integration issues when uninstalling a SuiteApp?
Weekly Update History (1)
Added an entry for New SDF Custom Object for Custom Tools.
View Oracle DocsWas this article helpful?