Create the Extension Framework

Documentation article about Create the Extension Framework

·3 min read·View Oracle Docs

Create the Extension Framework

Create the Extension Framework

You can create an extension manually or by using the gulp extension:create command as described in Create a Baseline Extension. For this tutorial, create your extension manually as described in the following steps.

  1. Access the top-level extension development directory you created when you installed the extension developer tools.

  2. In the top-level extension development directory, unless it already exists, create a new directory named Workspace.

  3. In the Workspace directory, set up the folders for this extension so that they look like this:

    javascript
    1Workspace/
    2 CDRExample
    3 Modules/
    4 CDRExample/
    5 JavaScript/
    6 Templates/
  4. In the Workspace/CDRExample directory, create a manifest.json file and place the following code in that file.

    json
    1{
    2 "name": "CDRExample",
    3 "fantasyName": "Context Data Request Example",
    4 "vendor": "ExampleVendor",
    5 "version": "1.0.0",
    6 "type": "extension",
    7 "target": "SCA,SCS",
    8 "target_version": {
    9 "SCA": ">=20.2.0",
    10 "SCS": ">=20.2.0"
    11 },
    12 "description": "An example extension to demonstrate contextDataRequest",
    13 "skins": [],
    14 "templates": {
    15 "application": {
    16 "shopping": {
    17 "files": [
    18 "Modules/CDRExample/Templates/cdr_example.tpl"
    19 ]
    20 }
    21 }
    22 },
    23 "javascript": {
    24 "entry_points": {
    25 "shopping": "Modules/CDRExample/JavaScript/CDRExample.js"
    26 },
    27 "application": {
    28 "shopping": {
    29 "files": [
    30 "Modules/CDRExample/JavaScript/CDRExample.js",
    31 "Modules/CDRExample/JavaScript/CDRExample.View.js"
    32 ]
    33 }
    34 }
    35 },
    36 "local_folder": "Workspace\\CDRExample"
    37}

--- Context from https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1516375394.html --- A baseline extension is a set of files, installed locally in your extension development directory. You use these files as a basis to build any extension for your Commerce web store or SCIS implementation.

When you run the gulp extension:create command, the developer tools create this baseline extension in a Workspace directory within your top-level extension development directory. The baseline extension starts out with one module that you design, based on your needs. It can include any combination of the following file types within one new module:

  • Templates

  • Sass

  • Configuration

  • JavaScript

  • SuiteScript 1.0

  • SuiteScript 2.0

Note:

Only 2020.1 Extension Developer Tools and later include the SuiteScript 2.0 file type as an option.

To create a baseline extension:

  1. Open a command line or terminal.

  2. Access the top-level extension development directory you created when you installed the extension developer tools.

  3. Enter the following command:

    gulp extension:create

  4. When prompted, enter the information for your baseline extension.

    Important:

    Note the following requirements and behavior:

    • Unless otherwise directed, create all entries using only alphanumeric characters without spaces.

    • Pressing Enter results in the default value.

    Set Your Extension Fantasy Name

    Provide a name for your extension as you want it to appear in the NetSuite user interface. This can contain special characters and spaces. For example: My Cool Extension!

    Set Your Extension Name

    Provide a name for your extension's files and folders within your development environment.

    Set the Vendor Name

    Enter your business, vendor, or partner name.

    Assign a Version Number

    Add a version number for your extension.

    Important:

    To take advantage of extension update requirements

Frequently Asked Questions (4)

Do I need any specific version of the Extension Developer Tools to use SuiteScript 2.0 files?
Yes, only the 2020.1 Extension Developer Tools and later include SuiteScript 2.0 file types as an option.
What are the prerequisites for creating the extension framework manually?
You need to have the extension developer tools installed and your top-level extension development directory set up before creating the extension framework manually.
What directory structure is required when creating an extension manually?
You need a directory named 'Workspace' within your top-level extension development directory. Inside 'Workspace', create another directory for your extension, which contains a 'Modules' folder and subfolders for 'JavaScript' and 'Templates'.
How does the 'manifest.json' file influence the extension creation?
The 'manifest.json' file contains essential configuration details for the extension, like 'name', 'vendor', version information, file structure for templates and JavaScript, and target applications (SCA, SCS). Without this file, the extension won't be configured correctly.
Source: Create the Extension Framework Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →