Index of every page on this site: llms.txt
All skills
oracle avatar

/netsuite-sdf-safe-guide

@25488ef
Run it yourself

Comprehensive NetSuite SDF best practices based on the SAFE Guide (12 principles + appendices). Generates Object XML for all 14 script types, enforces governance limits, security patterns, and defensive coding. Includes N/cache, N/query, concurrency limits, OAuth 2.0 guidance, legacy TBA guardrails, CustomTool runtime patterns, REST Web Services (2026.1 features), and 140+ documented pitfalls. Essential for SuiteApp and Account Customization development.

Use this Skill: https://skilld.dev/gh/oracle/netsuite-suitecloud-sdk/netsuite-sdf-safe-guide

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesappendicesappendix-application-xml.md

≈917 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Appendix: SuiteApp application.xml — Pre-Uninstall Lifecycle Hook

Applies to: SuiteApp projects only. Not applicable to Account Customization Projects (ACPs).

Overview

The application.xml file is an optional SDF project file placed at the project root (alongside manifest.xml and deploy.xml). It enables custom SuiteScript logic to run before a SuiteApp is uninstalled — a pre-uninstall lifecycle phase not available through any other SDF mechanism.

File Location

src/
  application.xml     ← optional, auto-discovered by SDF
  manifest.xml
  deploy.xml

XML Structure

<?xml version="1.0" encoding="UTF-8"?>
<application>
  <hooks>
    <beforeundeploy>
      <!-- Reference an SDFInstallationScript Object XML and its deployment -->
      <script>
        <path>~/Objects/customscript_[uninstall_cleanup].xml</path>
        <run>customdeploy_[uninstall_cleanup]</run>
      </script>
    </beforeundeploy>
  </hooks>
</application>

Note: The exact child element structure inside <beforeundeploy> should be verified against Oracle's Lifecycle Hooks documentation. The outer <application><hooks><beforeundeploy> wrapper is confirmed by Oracle.

How It Works

  1. Create an SDFInstallationScript (.js file + Object XML) containing your cleanup logic.
  2. Reference the Object XML path and deployment ID in application.xml.
  3. When a SuiteApp is uninstalled, NetSuite runs the referenced script before the uninstall process removes SuiteApp components.
  4. The script has access to record data and the File Cabinet before they are deleted.

When to Use

  • Clean up custom records or data before the SuiteApp schema is removed
  • Revoke API tokens or external service credentials
  • Archive data that would otherwise be permanently lost
  • Send notifications about the pending uninstall
  • Delete custom records, files, or folders that should not survive the uninstall

Comparison: application.xml vs BundleInstallationScript

Aspect BundleInstallationScript application.xml beforeUndeploy
Mechanism Standalone script type with JS entry points References an SDFInstallationScript via XML config
Lifecycle phases afterInstall, afterUpdate, afterUninstall Before uninstall begins
Timing Runs AFTER install/update/uninstall completes Runs BEFORE uninstall starts
Data access After uninstall: schema already removed Before uninstall: full access to records and files
Required? No No (optional file)
Distribution SuiteApp (bundle) only SuiteApp only
Configuration JavaScript entry point functions XML reference to SDFInstallationScript

Key Notes

  • application.xml is optional; SDF deployment succeeds without it
  • The file is NOT included in deploy.xml; SDF auto-discovers it at the project root
  • The referenced SDFInstallationScript must exist as an Object XML file in your project
  • Use application.xml when you need to act BEFORE data is removed; use BundleInstallationScript's afterUninstall when you need to act AFTER removal
  • For install and update lifecycle handling, continue using BundleInstallationScript; application.xml only supports beforeUndeploy

Related

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill is a comprehensive developer guide for NetSuite SuiteCloud Development Framework (SDF), based on Oracle's official SAFE Guide. It provides instructions, XML templates, and architectural patterns for SuiteScript development. The analysis found no malicious patterns, prompt injection attempts, or data exfiltration risks. It correctly promotes security best practices, such as using least-privilege roles and NetSuite's native secrets management.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW · No issues

Signed by skilld at 25488ef. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 5 months ago
metadata
{
  "author": "Oracle NetSuite",
  "version": "1.0"
}

README badge

README badge for oracle/netsuite-suitecloud-sdk/netsuite-sdf-safe-guide