Introduction to SDF
The SuiteCloud Development Framework (SDF) is NetSuite's modern development platform for building, managing, and deploying customizations. This guide provides comprehensive coverage of SDF development from fundamentals to real-world scenarios.
What is SDF?
SDF is a development framework that allows you to:
- Build customizations locally using your preferred IDE (VSCode)
- Version control all customizations as code (XML and JavaScript)
- Deploy changes consistently across accounts (Sandbox → Production)
- Collaborate with team members using Git workflows
┌─────────────────────────────────────────────────────────────────────────────┐
│ SDF DEVELOPMENT WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ VSCode │ │ GitHub │ │ NetSuite │
│ (Local) │ ──── │ (Source) │ ──── │ (Deployed) │
└──────────────┘ └──────────────┘ └──────────────┘
│ │ │
▼ ▼ ▼
Write Code Version Control Live System
Test Locally Collaboration Users Access
Validate Code Review Production
SDF vs Traditional Development
| Aspect | Traditional (UI-Based) | SDF (Code-Based) |
|---|---|---|
| Development | Point-and-click in NetSuite UI | Write code in VSCode locally |
| Version Control | Manual backups, no history | Full Git integration |
| Deployment | Copy/paste, manual recreation | Automated, consistent deployment |
| Collaboration | One person at a time | Multiple developers, branching |
| Rollback | Difficult, manual | Easy with Git history |
| Testing | Only in NetSuite | Local validation before deploy |
What Can You Build with SDF?
Scripts (SuiteScript 2.1)
| Script Type | Purpose | Trigger |
|---|---|---|
| Suitelet | Custom pages/forms, reports | URL access |
| User Event | Record validation, automation | Record save/load |
| Client Script | UI validation, field changes | User interaction |
| Scheduled Script | Background jobs, reports | Time-based schedule |
| Map/Reduce | Large data processing | Manual or scheduled |
| RESTlet | External API integration | HTTP requests |
| Workflow Action | Custom workflow logic | Workflow execution |
Custom Objects
| Object Type | Purpose |
|---|---|
| Custom Records | New data tables |
| Custom Fields | Extend standard records |
| Custom Lists | Dropdown values |
| Saved Searches | Reusable queries |
| Workflows | Business process automation |
| Forms | Custom entry forms |
| Roles | User permissions |
SDF Project Components
📁 MySuiteProject/
├── 📄 suitecloud.config.js # Project configuration
├── 📄 manifest.xml # What to deploy
├── 📄 deploy.xml # Deployment settings
├── 📁 src/
│ ├── 📁 FileCabinet/
│ │ └── 📁 SuiteScripts/ # JavaScript files
│ │ ├── 📁 Suitelets/
│ │ ├── 📁 UserEvents/
│ │ ├── 📁 ClientScripts/
│ │ ├── 📁 ScheduledScripts/
│ │ ├── 📁 MapReduce/
│ │ ├── 📁 RESTlets/
│ │ └── 📁 Libraries/
│ └── 📁 Objects/ # XML definitions
│ ├── customrecord_*.xml
│ ├── customsearch_*.xml
│ ├── custworkflow_*.xml
│ └── ...
└── 📁 .git/ # Version control
Development Lifecycle
┌─────────────────────────────────────────────────────────────────────────────┐
│ SDF DEVELOPMENT LIFECYCLE │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────┐
│ PLAN │ Define requirements, design solution
└────┬─────┘
│
▼
┌──────────┐
│ BUILD │ Write scripts, create objects in VSCode
└────┬─────┘
│
▼
┌──────────┐
│ VALIDATE │ SuiteCloud: Validate Project
└────┬─────┘
│
▼
┌──────────┐
│ DEPLOY │ Deploy to Sandbox
└────┬─────┘
│
▼
┌──────────┐
│ TEST │ Test in Sandbox environment
└────┬─────┘
│
▼
┌──────────┐
│ REVIEW │ Code review via Pull Request
└────┬─────┘
│
▼
┌──────────┐
│ RELEASE │ Deploy to Production
└──────────┘
Prerequisites
Before starting SDF development, ensure you have:
| Requirement | Purpose |
|---|---|
| VSCode | Primary development IDE |
| SuiteCloud Extension | NetSuite integration for VSCode |
| Node.js | Required for SuiteCloud CLI |
| Git | Version control |
| NetSuite Account | Sandbox for development/testing |
| Token-Based Auth | Secure API authentication |
SuiteScript 2.1 Overview
This guide uses SuiteScript 2.1 which provides modern JavaScript syntax:
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
*/
define(['N/ui/serverWidget', 'N/record', 'N/search'],
(serverWidget, record, search) => {
// Arrow functions
const onRequest = (context) => {
// Const/let instead of var
const form = serverWidget.createForm({ title: 'My Form' });
// Template literals
const message = `Request method: ${context.request.method}`;
// Destructuring
const { parameters } = context.request;
context.response.writePage(form);
};
return { onRequest };
});
Key SuiteScript 2.1 Features
| Feature | Example |
|---|---|
| Arrow Functions | const fn = (x) => x * 2; |
| Template Literals | `Hello ${name}` |
| Const/Let | const x = 1; let y = 2; |
| Destructuring | const { id, name } = record; |
| Default Parameters | function fn(x = 10) {} |
| Spread Operator | const arr = [...items, newItem]; |
What You'll Learn
This documentation covers:
Fundamentals
- Getting Started - Project setup, configuration, structure
- Script Types - All 7 script types with examples
- Custom Objects - Records, fields, searches, workflows
Practical Application
- Real-World Scenarios - Complete end-to-end implementations
- Deployment - Sandbox, production, rollback
- Best Practices - Standards, error handling, performance
Quick Links
| Section | Description |
|---|---|
| Project Setup | Create your first SDF project |
| Suitelet Development | Build custom pages |
| User Event Scripts | Automate record operations |
| Invoice Approval Scenario | Complete workflow implementation |
Next Steps
Start with SDF Project Setup to create your first SDF project.