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