Working with NetSuite SDF and Github


About SDF
SDF refers to the suiteCloud development framework; it allows you to manage and develop NetSuite customizations and suiteapps locally in your computer.
Installation Prerequisites
Download and install Oracle Java JDK version 17
Download and install Node.js latest version
Enable SuiteCloud development framework under setup→ company → Enable features→ SuiteCloud → SuiteCloud Development Framework
Similary enable OAuth 2.0
Install SDF for Visual Studio
Go to VSCode → extensions and search and install SuiteCloud Extension for Visual Studio. Once installed, you can start using by pressing the buttons CTRL + SHIFT + P
Then type suitecloud: create project
It will automatically create the following folder structure for your SDF project. In this project, I’ll use SuiteCloud CLI instead of the Visual Studio extension.
Install Suitecloud CLI
I’ll install Suitecloud CLI from npm: https://www.npmjs.com/package/@oracle/suitecloud-cli
Go to VS code terminal and type
npm install -g --acceptSuiteCloudSDKLicense @oracle/suitecloud-cli
This will install the SuiteCloud CLI on your computer.
To use the CLI, you need to type: suitecloud and press enter
Once you type the suitecloud, you will have all the commands that you can use with the suitecloud CLI.
A Sample Hello World in Client Script
Type the following in command prompt
suitecloud project:create -i
We’ll select the NetSuite customization project for this tutorial.
This step will generate the required folders.
After creating a project, I’ll create a client script file using command
suitecloud
[file:create
](file:create) -i
file abc.js is created in the suitescripts folder.
I added hello world in the page init function:
Now I’ll upload this file to my NetSuite account. Before we can upload the file, we need to setup a NetSuite account. To do that, type the following command:.
suitecloud account:setup
Select browser-based authentication to complete the account setup process. After the account setup process is complete, we need to validate the project before we can deploy.
Type the following command to validate the project
suitecloud project:validate -i
Now let us upload the files to the NetSuite account. The file is uploaded using the following commands:
suitecloud
[file:upload
](file:upload) -i
We can see that the file is successfully uploaded to the Netsuite file cabinet.
Import and modify the objects
Use suitecloud object:import -i
to import an object.
It is easier to import object by using VS code SuiteCloud Extension than using SuiteCloud CLI
Type CTRL +SHIFT +P and type suitecloud: import objects and follow the rest of the instruction.
I downloaded the following object file:
I’ll try to modify this object file and reupload it to the NetSuite account. I added the following to the list and clicked save.
<customvalue scriptid="value_5_t1517276_853">
<abbreviation></abbreviation>
<isinactive>F</isinactive>
<value>No Rating</value>
</customvalue>
Before we can deploy this project, we need to add dependency, validate, and then deploy it.
Type suitecloud project:adddependencies -i
This step will add any dependency to the manifest file.
There is another file called deploy.xml, SDF uses this file to determine the order in which files and objects are deployed to a target NetSuite account
The manifest.xml file is a project file that contains metadata about a SuiteCloud project. The manifest file is located at the root of the project folder.
The manifest file contains the following information about a project:
Project name: The name of the project
Framework version: The version of the framework
Dependencies: Any dependencies on features, records, or files
Now we’ll deploy the project.
Type CTRL + SHIFT + P then type suitecloud: Deploy Project
and follow the instructions. All your files and objects will be uploaded.
We can see that a new dropdown No rating is added to the list.
There are two ways you can use SuiteCloud SDF. One way is to install the SuiteCloud extension on Visual Studio Code. The second way is to download and install SuiteCloud CLI from npm.
There are two types of SDF projects: SuiteApp projects and account customization projects. With Suite App projects we can distribute commercially, it supports locking objects and hiding files. Account customization projects are used to customize own accounts; they partially allow importing objects.
Download and Install git
from here : https://git-scm.com/downloads
Once downloaded, we can start using git with github.
Upload files to Github
Go to VS code source control and click on publish to VS code.
Before that, create a repository on Github.com
Once repositery is created, you will be shown the following commands that you need to type in the vs. code command prompt.
echo "# SuiteScript" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/devanuragkum/SuiteScript.git
git push -u origin main
After you modify the file, you need to type the following commands to commit the changes.
git add *
git commit -m "second commit"
git push -u origin main
Changes are successfully uploaded to the github:
This completes our tutorial.
Subscribe to my newsletter
Read articles from Anurag Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Anurag Kumar
Anurag Kumar
I am a NetSuite Certified SuiteCloud Developer with over 8 years of work experience.