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

┌─────────────────────────────────────────────────────────────────────────────┐
│ WHICH DEPLOYMENT METHOD DO I NEED? │
└─────────────────────────────────────────────────────────────────────────────┘

What are you trying to do?

├─► "I want to test a single script quickly"
│ └─► Use UPLOAD FILE (Section 1)

├─► "I want to deploy specific scripts only"
│ └─► Use PARTIAL DEPLOY (Section 2)

├─► "I want to move code between sandboxes"
│ └─► Use SANDBOX TO SANDBOX (Section 3)

└─► "I want to release to production"
└─► Use 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

┌─────────────────────────────────────────────────────────────────────────────┐
│ UPLOAD FILE IN VSCODE │
└─────────────────────────────────────────────────────────────────────────────┘

Step 1: Right-click on the script file


Step 2: Select "Upload File to Account"


Step 3: Choose target account (Sandbox/Production)


Step 4: File uploads directly to File Cabinet


Step 5: Test immediately 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

┌─────────────────────────────────────────────────────────────────────────────┐
│ QUICK TEST WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘

┌────────────┐ ┌─────────────┐ ┌─────────────┐ ┌──────────┐
│ Edit │────►│ Upload │────►│ Test in │────►│ Repeat │
│ Script │ │ File │ │ NetSuite │ │ if needed│
└────────────┘ └─────────────┘ └─────────────┘ └──────────┘
│ │
└──────────────────────────────────────────────────────────┘
Quick iteration loop

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

┌─────────────────────────────────────────────────────────────────────────────┐
│ PARTIAL DEPLOYMENT DECISION │
└─────────────────────────────────────────────────────────────────────────────┘

What do you want to deploy?

├─► Just the script file (no XML changes)
│ └─► Use: suitecloud file:upload

├─► One or two specific scripts
│ └─► Use: suitecloud object:deploy --scriptid

├─► All scripts of a certain type
│ └─► Use: suitecloud object:deploy --type

└─► A specific feature set
└─► Use: deploy.xml configuration

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

┌─────────────────────────────────────────────────────────────────────────────┐
│ SANDBOX PROMOTION PATH │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────┐ ┌──────────┐ ┌──────────┐
│ DEV │ ──────► │ QA │ ──────► │ UAT │
│ Sandbox │ │ Sandbox │ │ Sandbox │
└──────────┘ └──────────┘ └──────────┘
│ │ │
│ │ │
Development QA Testing User Acceptance
& Unit Testing & Integration & Sign-off

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

┌─────────────────────────────────────────────────────────────────────────────┐
│ SANDBOX TO SANDBOX WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘

Step 1: Validate
┌────────────────────────────────────────────────────────────────────┐
│ suitecloud project:validate │
└────────────────────────────────────────────────────────────────────┘


Step 2: Deploy to target sandbox
┌────────────────────────────────────────────────────────────────────┐
│ suitecloud project:deploy --account "QA_Sandbox" │
└────────────────────────────────────────────────────────────────────┘


Step 3: Verify in NetSuite
┌────────────────────────────────────────────────────────────────────┐
│ Check scripts deployed → Test functionality → Review logs │
└────────────────────────────────────────────────────────────────────┘

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

┌─────────────────────────────────────────────────────────────────────────────┐
│ PRODUCTION DEPLOYMENT WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────────────┐
│ UAT Approved │
└────────┬─────────┘


┌──────────────────────────────────────────────────────────────────┐
│ STEP 1: PREPARE │
│ ☐ Code reviewed and approved │
│ ☐ UAT sign-off obtained │
│ ☐ Backup production objects │
│ ☐ Schedule deployment window │
└──────────────────────────────┬───────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────┐
│ STEP 2: BACKUP (Important!) │
│ suitecloud object:import --account "Production" --scriptid "*" │
└──────────────────────────────┬───────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────┐
│ STEP 3: DEPLOY │
│ suitecloud project:deploy --account "Production" │
│ OR │
│ suitecloud object:deploy --scriptid "..." --account "Production"│
└──────────────────────────────┬───────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────┐
│ STEP 4: VERIFY │
│ ☐ Scripts visible in NetSuite │
│ ☐ Test critical transactions │
│ ☐ Check execution logs │
│ ☐ Monitor for 24-48 hours │
└──────────────────────────────────────────────────────────────────┘

Production Commands

# Step 1: Validate
suitecloud project:validate

# Step 2: Backup current production (save to 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:

┌─────────────────────────────────────────────────────────────────────────────┐
│ PARTIAL PRODUCTION DEPLOY │
└─────────────────────────────────────────────────────────────────────────────┘

Scenario: Deploy only the invoice script fix to production

Step 1: Backup the specific script
┌────────────────────────────────────────────────────────────────────┐
│ suitecloud object:import --account "Production" │
│ --scriptid "customscript_invoice_ue" │
└────────────────────────────────────────────────────────────────────┘


Step 2: Deploy only that script
┌────────────────────────────────────────────────────────────────────┐
│ suitecloud object:deploy --account "Production" │
│ --scriptid "customscript_invoice_ue" │
└────────────────────────────────────────────────────────────────────┘


Step 3: Verify
┌────────────────────────────────────────────────────────────────────┐
│ Test the specific functionality in production │
└────────────────────────────────────────────────────────────────────┘

5. Deployment Order (Dependencies)

When deploying multiple object types, follow this order:

┌─────────────────────────────────────────────────────────────────────────────┐
│ DEPLOYMENT ORDER │
└─────────────────────────────────────────────────────────────────────────────┘

DEPLOY FIRST (Dependencies)
┌────────────────────────────────────────────────────────────────────┐
│ 1. Custom Lists │
│ 2. Custom Records │
│ 3. Custom Fields │
└────────────────────────────────────────────────────────────────────┘


DEPLOY SECOND (Business Logic)
┌────────────────────────────────────────────────────────────────────┐
│ 4. Library Scripts │
│ 5. Scheduled Scripts │
│ 6. Map/Reduce Scripts │
│ 7. RESTlets │
└────────────────────────────────────────────────────────────────────┘


DEPLOY THIRD (User Interface)
┌────────────────────────────────────────────────────────────────────┐
│ 8. User Event Scripts │
│ 9. Client Scripts │
│ 10. Suitelets │
└────────────────────────────────────────────────────────────────────┘


DEPLOY LAST (Automation)
┌────────────────────────────────────────────────────────────────────┐
│ 11. 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