Single Entry Point for an Extension

Documentation article about Single Entry Point for an Extension

·1 min read·View Oracle Docs

Single Entry Point for an Extension

Single Entry Point for an Extension

If you created the files and folders described in Folder Structure, you can walk through this example to see how a single entry point works.

In the extension's manifest.json file, add the path to the ModuleOne.js file as the entry point for each application your extension will be applied to. For example, if your extension only applies to the checkout application, set the entry point as shown in the following example:

javascript
"javascript": {
"entry_points": {
"shopping": "Modules/ModuleOne/JavaScript/ModuleOne.js"

Now if you run the gulp command to update the extension manifest:

javascript
gulp extension:update-manifest

And then run a local test of your extension with this gulp command:

javascript
gulp extension:local

When you access your local site and check your browser's developer console, you see this message:

none
ModuleOne loaded!

This result is expected because, although the extension's manifest file has been updated and includes the ModuleTwo file in its list of files, you have not called the second module.

When your extension is loaded, only the entry point file in the manifest is called. Therefore, if you want additional code to be called, you need to add calls to that entry point file's mountToApp() method. To learn more, see Calling Files in Other Modules.

Frequently Asked Questions (4)

What is the purpose of setting an entry point in the manifest.json file for a NetSuite extension?
The entry point in the manifest.json file specifies which JavaScript file should be loaded as the main module for the extension when applied to a specific application, like checkout.
Do I need to run any specific commands after defining an entry point in a NetSuite extension?
Yes, you need to run 'gulp extension:update-manifest' to update the extension's manifest and then 'gulp extension:local' to test the extension locally.
How can I include additional modules in my NetSuite extension beyond the defined entry point?
To include additional modules, you must add calls to those modules' code using the entry point file's 'mountToApp()' method.
What message should I expect to see in the browser's developer console when running a local test of my extension with a single entry point?
You should see the message 'ModuleOne loaded!' in the developer console, indicating that the entry point module has been loaded successfully.
Source: Single Entry Point for an Extension 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 →