Edit the Extension Manifest: Page

Learn how to manually edit the manifest.json in NetSuite extensions to define assets, templates, and scripts.

·3 min read·View Oracle Docs

The manifest.json file in a NetSuite extension serves as a central repository for details about how an extension is constructed and deployed. It is automatically generated within your extension's Workspace directory and is crucial for compiling resources like JavaScript, HTML templates, and more.

What is the Manifest File in NetSuite Extensions?

The manifest.json is auto-generated when the gulp extension:create command is executed. It compiles necessary resources such as JavaScript, JSON files, SuiteScript, HTML templates, Sass, and other assets pivotal for deploying an extension.

Metadata Configuration

The manifest.json includes metadata fields:

  • name: A unique identifier for the extension, using alphanumeric characters without spaces.
  • fantasyName: A label with special characters, used for display.
  • vendor: The required vendor name.
  • type: Set to 'extension' and required.
  • target: Specifies supported SuiteCommerce or SCA applications.
  • target_version: Lists supported SuiteCommerce or SCA application versions.
  • version: The version format, essential for updates.
  • description: An optional brief summary of what the extension does.

How to Handle Manual Edits to the Manifest

While largely generated automatically, manual edits to the manifest.json are sometimes necessary, such as when modifying Sass entry points or content type labels. Note that gulp extension:local and gulp extension:deploy overwrite manual changes. To maintain these modifications, use:

  • gulp extension:local --preserve-manifest
  • gulp extension:deploy --preserve-manifest

Defining Assets and Templates

The configuration of assets and templates is paramount:

  • Assets: Define paths to images, fonts, and services which are treated as extension assets deployed on NetSuite servers.
  • Templates: Specify HTML template files for different application aspects like shopping, myaccount, and checkout.

Specifying JavaScript and Sass Settings

Extensions also require precise specification of JavaScript and Sass files:

  • JavaScript: Define entry points for different applications and list all files for deployment.
  • Sass: Ensure the correct order for application entry points and Sass file integration.

Including SSP Libraries and SuiteScript 2

Describe all SuiteScript and SSP Libraries required for the extension:

  • SSP Libraries: Declare SuiteScript files necessary for the extension.
  • SuiteScript 2: Define SuiteScript 2.0 services needed.

Custom Page Types

For custom CMS Page Types, manually adding a page type definition within the manifest.json is essential. This ensures the creation of the relevant CMS Page Type record in NetSuite.

Page Types

Each new page type includes fields such as its name, display name, description, base URL path, and settings record if applicable.

Key Takeaways

  • manifest.json is critical for extension deployment, detailing all necessary resources.
  • Manual edits must be preserved with specific Gulp commands during deployment.
  • Proper configuration of assets, templates, JavaScript, and Sass ensures smooth extension activation.
  • Custom CMS Page Types require manual entry for successful deployment.

Frequently Asked Questions (4)

How do I add a new CMS Page Type to my NetSuite extension?
To add a new CMS Page Type, you must manually include a page type definition in your extension's manifest.json. This is necessary to ensure that the CMS Page Type record is created in NetSuite when the Extension SuiteApp is installed.
What attributes are required when defining a new page type in the manifest.json?
When defining a new page type in the manifest.json, you need to include the 'name' and 'displayName' attributes. The 'name' sets the Page Type name, which must match the name used when registering with PageTypeComponent.registerPageType(). The 'displayName' sets the label shown in SMT.
Can I associate a custom record with a new page type?
Yes, you can associate a custom record with a new page type using the 'settingsRecord' attribute in the page type definition. This ID allows the page type to inherit the settings of the custom record when added or edited.
Is it possible to register alternative templates for a new page type in NetSuite?
Yes, you can register alternative templates for a new page type using the Extensibility API. These templates can serve as default or optional layouts for your page types, available to choose from when creating pages in SMT.
Source: Page 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 →