Skip to main content

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

  1. Download from https://nodejs.org/ (LTS version)
  2. Run installer with default options
  3. Verify installation:
node --version
# Expected: v18.x.x or higher

npm --version
# Expected: 9.x.x or higher

VSCode

  1. Download from https://code.visualstudio.com/
  2. Install with default options

SuiteCloud Extension

  1. Open VSCode
  2. Press Ctrl+Shift+X (Extensions)
  3. Search "SuiteCloud"
  4. 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:

  1. Create folder: C:\Projects\my-netsuite-project
  2. VSCode → File → Open Folder → Select folder

Step 3: Initialize SDF Project

Using VSCode Command Palette

  1. Press Ctrl+Shift+P
  2. Type "SuiteCloud: Create Project"
  3. Select project type:
┌─────────────────────────────────────────────────────┐
│ Select Project Type │
├─────────────────────────────────────────────────────┤
│ │
│ → Account Customization Project (Recommended) │
│ For scripts, custom records, workflows │
│ │
│ SuiteApp Project │
│ For distributable applications │
│ │
└─────────────────────────────────────────────────────┘
  1. Enter project name (e.g., my-netsuite-project)
  2. 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:

CredentialWhere to Find
Account IDSetup → Company → Company Information
Token IDSetup → Users/Roles → Access Tokens
Token SecretProvided when token was created

Set Up Account in VSCode

  1. Press Ctrl+Shift+P
  2. Type "SuiteCloud: Set Up Account"
  3. 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

  1. Press Ctrl+Shift+P
  2. Type "SuiteCloud: Validate Project"
  3. 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

  1. Press Ctrl+Shift+P
  2. Type "SuiteCloud: Create SuiteScript"
  3. Select "Suitelet"
  4. 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