Skip to main content

SDF Deployment Workflow Guide

This guide covers all deployment scenarios from testing a single file to full production releases.


Choose Your Deployment Method

What do you need?

├─── Test single script ──────────► Upload File (Section 1)

├─── Deploy specific scripts ─────► Partial Deploy (Section 2)

├─── Move between sandboxes ──────► Sandbox to Sandbox (Section 3)

└─── Release to production ───────► Production Deploy (Section 4)

1. Upload File - Quick Single File Testing

Use Upload File when you want to quickly test changes to a single script without deploying the entire project.

When to Use Upload File

Use Upload FileDon't Use Upload File
Testing a script fixDeploying new objects
Debugging an issueFirst-time deployment
Quick iteration during developmentProduction releases
Updating a library fileChanges to XML objects

How to Upload a Single File

1. Right-click file → 2. Upload to Account → 3. Choose account → 4. Test in NetSuite

Steps:

  1. Open the script file in VSCode
  2. Right-click on the file in the Explorer panel
  3. Select "SuiteCloud: Upload File to Account"
  4. Select the target account
  5. File is uploaded instantly

Method B: Command Line

# Upload a specific file
suitecloud file:upload --paths "/SuiteScripts/UserEvents/invoice_ue.js" --account "Dev_Sandbox"

# Upload multiple files
suitecloud file:upload --paths "/SuiteScripts/invoice_ue.js,/SuiteScripts/utils.js" --account "Dev_Sandbox"

Upload File Workflow

Edit → Upload → Test → Repeat
▲ │
└──────────────────────┘

Important Notes for Upload File

  • Only uploads the file - does not update script deployment settings
  • Script must already exist - use full deploy first, then upload for updates
  • No XML changes - if you changed the script XML, use object:deploy instead
  • Check File Cabinet path - file must go to the correct folder

2. Partial Deployment - Deploy Specific Objects

Use partial deployment when you want to deploy only certain scripts or objects, not the entire project.

Decision Flow

What to deploy?

├─── Script file only ────────► file:upload

├─── Specific scripts ────────► object:deploy --scriptid

├─── All of a type ───────────► object:deploy --type

└─── Feature set ─────────────► deploy.xml

Option A: Deploy by Script ID

Deploy one or more specific objects:

# Single object
suitecloud object:deploy --scriptid customscript_invoice_ue --account "Sandbox"

# Multiple objects (comma-separated)
suitecloud object:deploy --scriptid "customscript_invoice_ue,customscript_order_cs" --account "Sandbox"

# Using wildcard pattern
suitecloud object:deploy --scriptid "customscript_invoice_*" --account "Sandbox"

Option B: Deploy by Object Type

Deploy all objects of a specific type:

# All custom scripts
suitecloud object:deploy --type customscript --account "Sandbox"

# All custom records
suitecloud object:deploy --type customrecordtype --account "Sandbox"

# All custom lists
suitecloud object:deploy --type customlist --account "Sandbox"

Option C: Use deploy.xml

Create a deploy.xml file to define exactly what to deploy:

<?xml version="1.0" encoding="UTF-8"?>
<deploy>
<configuration>
<path>~/Objects/*</path>
</configuration>
<files>
<path>~/FileCabinet/SuiteScripts/invoice_ue.js</path>
<path>~/FileCabinet/SuiteScripts/order_cs.js</path>
</files>
<objects>
<path>~/Objects/customscript_invoice_ue.xml</path>
<path>~/Objects/customscript_order_cs.xml</path>
</objects>
</deploy>

Then deploy:

suitecloud project:deploy --account "Sandbox"

Partial Deployment Quick Reference

What to DeployCommand
Single file onlyfile:upload --paths "path/to/file.js"
Single objectobject:deploy --scriptid customscript_name
Multiple objectsobject:deploy --scriptid "script1,script2"
Pattern matchobject:deploy --scriptid "customscript_invoice_*"
By typeobject:deploy --type customscript
Custom selectionConfigure deploy.xml + project:deploy

3. Sandbox to Sandbox Deployment

Move your code between sandbox environments (Dev → QA → UAT).

Environment Flow

DEV Sandbox ──► QA Sandbox ──► UAT Sandbox ──► Production

Setup Accounts

First, configure all your sandbox accounts:

# Setup each account (run once per account)
suitecloud account:setup

# Verify all accounts
suitecloud account:list

Expected output:

Available accounts:
1. Dev_Sandbox (TSTDRV1111111) [default]
2. QA_Sandbox (TSTDRV2222222)
3. UAT_Sandbox (TSTDRV3333333)
4. Production (1234567)

Deploy Between Sandboxes

1. Validate → 2. Deploy to target → 3. Verify in NetSuite

Commands:

# Validate first
suitecloud project:validate

# Full deploy to QA
suitecloud project:deploy --account "QA_Sandbox"

# Or partial deploy
suitecloud object:deploy --scriptid "customscript_invoice_*" --account "QA_Sandbox"

After Sandbox Refresh

When a sandbox is refreshed from production, redeploy your customizations:

# Redeploy all customizations after refresh
suitecloud project:deploy --account "Dev_Sandbox"

4. Sandbox to Production Deployment

Deploy tested code from sandbox to production.

Production Deployment Flow

UAT Approved → 1. Prepare → 2. Backup → 3. Deploy → 4. Verify

Production Commands

# Step 1: Validate
suitecloud project:validate

# Step 2: Backup current production script definitions (XML → backup folder)
suitecloud object:import --account "Production" --scriptid "customscript_*" --destinationfolder "backup"

# Step 3a: Full deploy
suitecloud project:deploy --account "Production"

# Step 3b: Or partial deploy (safer for hotfixes)
suitecloud object:deploy --scriptid "customscript_invoice_ue" --account "Production"

Partial Production Deployment

For deploying only specific changes to production:

1. Backup script → 2. Deploy script → 3. Verify

5. Deployment Order (Dependencies)

When deploying multiple object types, follow this order:

1. Lists/Records/Fields → 2. Library/Scheduled/MR/RESTlet → 3. UE/CS/Suitelet → 4. Workflows

Phased Deployment Example

# Phase 1: Foundation
suitecloud object:deploy --type customlist --account "Production"
suitecloud object:deploy --type customrecordtype --account "Production"

# Phase 2: Scripts
suitecloud object:deploy --type customscript --account "Production"

# Phase 3: Workflows
suitecloud object:deploy --type workflow --account "Production"

6. Best Practices

Pre-Deployment Checklist

☐ Code validated (suitecloud project:validate)
☐ Tested in sandbox
☐ No hardcoded internal IDs
☐ Backup taken of target environment
☐ Deployment window approved (for production)

Post-Deployment Checklist

☐ Scripts visible in NetSuite
☐ Deployment status correct (Testing/Released)
☐ Test critical functionality
☐ Check execution logs for errors
☐ Git tag created (for production releases)

Common Commands Reference

# Validate project
suitecloud project:validate

# List accounts
suitecloud account:list

# Set default account
suitecloud account:setdefault --account "AccountName"

# Full deploy
suitecloud project:deploy --account "AccountName"

# Deploy specific object
suitecloud object:deploy --scriptid scriptid --account "AccountName"

# Upload single file
suitecloud file:upload --paths "path/to/file.js" --account "AccountName"

# Import objects (backup)
suitecloud object:import --account "AccountName" --scriptid "pattern"

# Preview deploy (dry run)
suitecloud project:deploy --dryrun

Quick Decision Guide

SituationMethodCommand
Testing a script changeUpload Filefile:upload or right-click in VSCode
Hotfix to productionPartial Deployobject:deploy --scriptid
Promote to QA sandboxFull Deployproject:deploy --account "QA"
New feature releaseFull Deployproject:deploy --account "Production"
Deploy one script typeType Deployobject:deploy --type customscript
Deploy feature subsetdeploy.xmlConfigure deploy.xml + project:deploy

Troubleshooting

ErrorSolution
"Account not found"Run suitecloud account:setup
"Authentication failed"Re-authenticate with account:setup
"Object already exists"Object will be updated (this is normal)
"Missing dependency"Deploy dependencies first (see Section 5)
"File not found"Check file path matches File Cabinet location

Next Steps