SuiteCloud Development FrameworkRelease NotesNew FeatureSDFSuiteCloud

beforeUndeploy Installation Hook in NetSuite 2026.1

Introducing the beforeUndeploy installation hook in NetSuite 2026.1 for custom pre-uninstall logic in SuiteApps.

·2 min read·NetSuite 2026.1·View Oracle Docs

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

  1. Create application.xml: Ensure this file exists at the root of your SuiteApp project.
  2. Define the Hook: Within application.xml, add a section like this:
    <hooks>
        <beforeUndeploy>
            <script>path/to/your/script.js</script>
        </beforeUndeploy>
    </hooks>
    
  3. 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?
To implement the beforeUndeploy hook, you need to create an `application.xml` file at the root of your SuiteApp project. Within this file, define a `<beforeUndeploy>` section under the `<hooks>` element and reference one or more SDF installation scripts where you will write your cleanup logic.
What kind of cleanup actions can I perform with the beforeUndeploy hook?
With the beforeUndeploy hook, you can delete custom records, remove associated files and folders, and execute any necessary cleanup scripts to handle business logic or workflows specific to the app’s uninstall process.
Do I need to create any new configuration files to use the beforeUndeploy hook?
Yes, you need to create a new `application.xml` file in the root directory of your SuiteApp project. This file will include the configuration for the beforeUndeploy hook.
Can the beforeUndeploy hook prevent data integration issues when uninstalling a SuiteApp?
Yes, by allowing developers to execute cleanup scripts before a SuiteApp is uninstalled, the beforeUndeploy hook helps ensure that associated data is correctly removed, which can prevent potential integration issues and maintain data integrity.

Weekly Update History (1)

SuiteCloud Development Frameworkadded

Added an entry for New SDF Custom Object for Custom Tools.

View Oracle Docs
Source: New beforeUndeploy Installation Hook Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?