SDF Project Setup
This guide walks you through creating a new SDF project from scratch using VSCode.
Project Setup Flow
┌─────────────────────────────────────────────────────────────────────────────┐
│ SDF PROJECT SETUP FLOW │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────────┐
│ START │
└──────┬───────┘
│
▼
┌─────────────────────────────────────┐
│ 1. Install Prerequisites │
│ ───────────────────────────────────│
│ • Node.js (LTS) │
│ • VSCode │
│ • SuiteCloud Extension │
│ • SuiteCloud CLI │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 2. Create Project Folder │
│ ───────────────────────────────────│
│ • Create empty folder │
│ • Open in VSCode │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 3. Initialize SDF Project │
│ ───────────────────────────────────│
│ Ctrl+Shift+P → │
│ "SuiteCloud: Create Project" │
│ • Select Account Customization │
│ • Enter project name │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 4. Configure Account │
│ ───────────────────────────────────│
│ Ctrl+Shift+P → │
│ "SuiteCloud: Set Up Account" │
│ • Enter Account ID │
│ • Enter Token credentials │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 5. Verify Setup │
│ ───────────────────────────────────│
│ Ctrl+Shift+P → │
│ "SuiteCloud: Validate Project" │
└───────────┬─────────────────────────┘
│
▼
┌──────────────┐
│ DONE! │
│ Ready to │
│ develop │
└──────────────┘
Step 1: Install Prerequisites
Node.js
- Download from https://nodejs.org/ (LTS version)
- Run installer with default options
- Verify installation:
node --version
# Expected: v18.x.x or higher
npm --version
# Expected: 9.x.x or higher
VSCode
- Download from https://code.visualstudio.com/
- Install with default options
SuiteCloud Extension
- Open VSCode
- Press
Ctrl+Shift+X(Extensions) - Search "SuiteCloud"
- Install Oracle SuiteCloud Extension for VS Code
SuiteCloud CLI
npm install -g @oracle/suitecloud-cli
Verify:
suitecloud --version
Step 2: Create Project Folder
# Create project directory
mkdir C:\Projects\my-netsuite-project
cd C:\Projects\my-netsuite-project
# Open in VSCode
code .
Or manually:
- Create folder:
C:\Projects\my-netsuite-project - VSCode → File → Open Folder → Select folder
Step 3: Initialize SDF Project
Using VSCode Command Palette
- Press
Ctrl+Shift+P - Type "SuiteCloud: Create Project"
- Select project type:
┌─────────────────────────────────────────────────────┐
│ Select Project Type │
├─────────────────────────────────────────────────────┤
│ │
│ → Account Customization Project (Recommended) │
│ For scripts, custom records, workflows │
│ │
│ SuiteApp Project │
│ For distributable applications │
│ │
└─────────────────────────────────────────────────────┘
- Enter project name (e.g.,
my-netsuite-project) - Wait for project initialization
Using Terminal
suitecloud project:create -t ACCOUNTCUSTOMIZATION -n "my-netsuite-project"
Step 4: Configure Account
Get Credentials from NetSuite
Before configuring, you need:
| Credential | Where to Find |
|---|---|
| Account ID | Setup → Company → Company Information |
| Token ID | Setup → Users/Roles → Access Tokens |
| Token Secret | Provided when token was created |
Set Up Account in VSCode
- Press
Ctrl+Shift+P - Type "SuiteCloud: Set Up Account"
- Follow the prompts:
┌─────────────────────────────────────────────────────┐
│ Account Setup Wizard │
├─────────────────────────────────────────────────────┤
│ │
│ Step 1: Account ID │
│ ───────────────── │
│ Enter: TSTDRV1234567 (Sandbox) │
│ or 1234567 (Production) │
│ │
│ Step 2: Authentication Method │
│ ───────────────────────────── │
│ → Token-Based Authentication (Recommended) │
│ │
│ Step 3: Token Credentials │
│ ───────────────────────── │
│ Token ID: xxxxxxxxxxxxxxxxxxxxx │
│ Token Secret: xxxxxxxxxxxxxxxxxxxxx │
│ │
│ Step 4: Account Name (for reference) │
│ ───────────────────────────────────── │
│ Enter: "Sandbox" or "Production" │
│ │
└─────────────────────────────────────────────────────┘
Using Terminal
suitecloud account:setup
Step 5: Verify Setup
Validate Project
- Press
Ctrl+Shift+P - Type "SuiteCloud: Validate Project"
- Wait for validation to complete
┌─────────────────────────────────────────────────────┐
│ Validation Results │
├─────────────────────────────────────────────────────┤
│ │
│ ✓ Project structure valid │
│ ✓ manifest.xml valid │
│ ✓ suitecloud.config.js valid │
│ ✓ No syntax errors found │
│ │
│ Validation completed successfully! │
│ │
└─────────────────────────────────────────────────────┘
Project Structure Created
After initialization, your project looks like:
📁 my-netsuite-project/
├── 📄 suitecloud.config.js # SDF configuration
├── 📄 manifest.xml # Deployment manifest
├── 📁 src/
│ ├── 📁 FileCabinet/
│ │ └── 📁 SuiteScripts/ # Your scripts go here
│ ├── 📁 Objects/ # Custom objects (XML)
│ └── 📁 Templates/ # HTML templates
└── 📁 node_modules/ # Dependencies
Key Files Explained
suitecloud.config.js
module.exports = {
defaultProjectFolder: 'src',
commands: {}
};
manifest.xml
<manifest projecttype="ACCOUNTCUSTOMIZATION">
<projectname>my-netsuite-project</projectname>
<frameworkversion>1.0</frameworkversion>
<dependencies>
<features>
<feature required="true">CUSTOMRECORDS</feature>
<feature required="true">SERVERSIDESCRIPTING</feature>
</features>
</dependencies>
</manifest>
Creating Your First Script
Create Folder Structure
# Create script folders
mkdir src\FileCabinet\SuiteScripts\Suitelets
mkdir src\FileCabinet\SuiteScripts\UserEvents
mkdir src\FileCabinet\SuiteScripts\ClientScripts
Create a Test Suitelet
- Press
Ctrl+Shift+P - Type "SuiteCloud: Create SuiteScript"
- Select "Suitelet"
- Enter filename:
test_suitelet.js
Or create manually:
src/FileCabinet/SuiteScripts/Suitelets/test_suitelet.js
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/ui/serverWidget'], (serverWidget) => {
const onRequest = (context) => {
const form = serverWidget.createForm({
title: 'My First Suitelet'
});
form.addField({
id: 'custpage_message',
type: serverWidget.FieldType.INLINEHTML,
label: ' '
}).defaultValue = '<h2>Hello from SDF!</h2><p>Your project is set up correctly.</p>';
context.response.writePage(form);
};
return { onRequest };
});
Deploy to Sandbox
Validate First
Ctrl+Shift+P → SuiteCloud: Validate Project
Deploy
Ctrl+Shift+P → SuiteCloud: Deploy to Account
→ Select your Sandbox account
→ Wait for deployment
Deployment Flow
┌─────────────────────────────────────────────────────────────────────────────┐
│ DEPLOYMENT FLOW │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────────┐
│ Your Code │
│ (Local) │
└──────┬───────┘
│
▼
┌─────────────────────────────────────┐
│ 1. Validate Project │
│ ───────────────────────────────────│
│ Check syntax, structure, XML │
└───────────┬─────────────────────────┘
│
▼
┌──────────────┐ Errors? ┌─────────────────┐
│ Valid? ├────────────────►│ Fix errors │
└──────┬───────┘ Yes └────────┬────────┘
│ No │
│ ◄──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 2. Package Project │
│ ───────────────────────────────────│
│ Bundle files for upload │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 3. Upload to NetSuite │
│ ───────────────────────────────────│
│ Transfer to target account │
└───────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 4. Install Objects │
│ ───────────────────────────────────│
│ Create scripts, records, etc. │
└───────────┬─────────────────────────┘
│
▼
┌──────────────┐
│ SUCCESS │
│ Deployed! │
└──────────────┘
Common Setup Issues
"Account not found"
- Verify Account ID is correct
- Check if using Sandbox ID (starts with TSTDRV) vs Production ID
"Authentication failed"
- Token may be expired - create new token in NetSuite
- Verify Token ID and Secret are correct
- Ensure token has proper role permissions
"Project validation failed"
- Check manifest.xml syntax
- Ensure all required folders exist
- Verify script file syntax
Next Steps
- Account Configuration - Managing multiple accounts
- Project Structure - Understanding all project files
- Your First Suitelet - Build a complete Suitelet