Introduction
A great script is useless if itβs deployed incorrectly. Poor deployment practices can lead to lost changes, broken dependencies, or even production downtime.
This blog explains how to design a safe, repeatable SuiteScript deployment process using sandbox testing, SuiteCloud Development Framework (SDF), and version control.
1οΈβ£ Understanding Environments
| Environment | Purpose | Access Level |
|---|---|---|
| Sandbox | Testing & development | Full access for devs |
| Production | Live data environment | Restricted deployment |
| Release Preview | Pre-upgrade testing | Read-only with limited scripts |
β Always build and test in Sandbox, then move to Production through controlled SDF deployment.
2οΈβ£ Why Use SDF (SuiteCloud Development Framework)?
SDF lets you develop, version, and deploy customizations outside the browser:
- Source-controlled XML and script files
- Command-line deployments (
suitecloud deploy) - Dependency management (manifest file)
- Support for CI/CD integration (GitHub Actions, Azure Pipelines)
3οΈβ£ Setting Up Your SDF Project
Step 1: Install SuiteCloud CLI
npm install -g @oracle/suitecloud-cli
Step 2: Authenticate to Your Account
suitecloud account:setup
Step 3: Create a Project
suitecloud project:create --type AccountCustomization --projectname MySuiteScripts
Step 4: Add Scripts and Objects
Place your files under FileCabinet/SuiteScripts/ and reference them in manifest.xml.
4οΈβ£ Sample manifest.xml
<manifest projecttype="ACCOUNTCUSTOMIZATION">
<dependencies>
<features>
<feature id="SUITESCRIPT" required="true"/>
</features>
</dependencies>
<files>
<path>FileCabinet/SuiteScripts/ue_auto_approval.js</path>
</files>
<objects>
<object type="script" scriptid="customscript_ue_auto_approval"/>
</objects>
</manifest>
β Defines dependencies, files, and record objects to be deployed together.
5οΈβ£ Deployment Workflow
| Stage | Task | Tool |
|---|---|---|
| 1. Develop | Write and test in Sandbox using SuiteScript 2.1 | NetSuite IDE / VS Code |
| 2. Validate | Check for missing features and errors | suitecloud project:validate |
| 3. Deploy to Sandbox | Internal testing build | suitecloud project:deploy |
| 4. Commit to Git | Version control snapshot | GitHub / Bitbucket |
| 5. Deploy to Production | Approved release deployment | CLI or CI/CD pipeline |
6οΈβ£ Testing Checklist Before Go-Live
| Category | Check |
|---|---|
| Functional | Script behaves as expected with test records |
| Permissions | Role and access validated |
| Governance | No timeouts or excessive usage |
| Logging | Clean, meaningful audit logs |
| Rollback | Backup of previous script version available |
7οΈβ£ CI/CD Automation Example (GitHub Actions)
name: Deploy to NetSuite
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install -g @oracle/suitecloud-cli
- run: suitecloud account:setup --authid ${{ secrets.NS_AUTH_ID }}
- run: suitecloud project:validate
- run: suitecloud project:deploy --account ${{ secrets.NS_ACCOUNT }}
β Enables automated testing and deployment whenever you push to main branch.
8οΈβ£ Rollback & Version Control
- Tag each release (e.g.,
v1.0.3) in Git. - Maintain a rollback branch with last-known-good scripts.
- In SDF, use
--backupflag to retain previous deployed version.
9οΈβ£ Common Deployment Issues
| Issue | Cause | Fix |
|---|---|---|
| MISSING_FEATURE_DEPENDENCY | Feature not enabled in target account | Enable under Setup > Company > Enable Features |
| INVALID_SCRIPT_ID | Mismatch between manifest and file path | Update manifest or rename file |
| PERMISSION_DENIED | Role lacks deploy rights | Grant SuiteScript Deployment permission |
π 10. Best Practices
β
Always deploy from Sandbox β Production.
β
Validate before deploying with project:validate.
β
Use Git for change tracking and peer reviews.
β
Document each deployment and rollback procedure.
β
Use SDF CLI parameters for secure tokens instead of storing credentials in scripts.
Conclusion
A structured deployment process is the foundation of professional NetSuite development.
By adopting SDF, version control, and CI/CD pipelines, you can deploy scripts safely and repeatablyβwithout downtime or data loss.
Your goal: βAutomate once, deploy everywhere confidently.β
Discover more from The NetSuite Pro
Subscribe to get the latest posts sent to your email.
Leave a Reply