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
--backup
flag 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