Entry Points Configuration for Custom Extensions in NetSuite

Configure entry points for custom extensions in NetSuite to manage module loading effectively and enhance site functionalities.

·2 min read·View Oracle Docs

Configuring entry points for custom extensions in NetSuite significantly simplifies module management and optimizes functionality. With the introduction of extension frameworks, you can now use a single entry point for an entire extension instead of separate entry points for each module, simplifying the development process.

How Do Entry Points Work?

When developing customizations, especially for earlier versions, you needed to define individual entry points for each module. Now, using the extension framework, extensions generally utilize one entry point. This only changes if you require different entry points for various applications on your site.

Example of a Single Entry Point for an Extension

For example, in the extension’s manifest.json file, you would indicate the path to your JavaScript file for the entry point applicable to the extension:

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

After updating the manifest, use the following gulp commands to update your extension:

javascript
gulp extension:update-manifest
gulp extension:local

When testing it on your local site, check the developer console for the message:

none
ModuleOne loaded!

This confirms that the entry point was successfully called, loading the associated module. If you need additional functionality, remember to call your modules through the mountToApp() method as needed.

Setting Up Different Entry Points for Site Applications

If running different code across various applications on your site is a requirement, you can specify multiple entry points in your manifest.json. Here's how to set it up:

javascript
1"javascript": {
2 "entry_points": {
3 "shopping": "Modules/ModuleOne/JavaScript/ModuleOne.js",
4 "myaccount": "Modules/ModuleTwo/JavaScript/ModuleTwo.js",
5 "checkout": "Modules/ModuleTwo/JavaScript/ModuleTwo.js"
6 }
7}

Once you save your changes, restart your local server. Accessing areas like the checkout or customer account should now display:

none
ModuleTwo loaded!

This setup allows you to manage code dependencies more effectively while keeping your logic contained within the same extension.

Key Considerations

  • Single vs. Multiple Entry Points: Use a single entry point for simple applications, but opt for multiple whenever distinct functionalities are needed across site applications.
  • Testing Your Configuration: Always monitor your developer console for output messages to ensure proper module loading during development.

Who This Affects

  • Developers: Those building and customizing extensions within the NetSuite environment.
  • Administrators: Individuals overseeing and managing custom projects on their NetSuite sites.

Key Takeaways

  • Entry points simplify the management of modules in NetSuite extensions.
  • One entry point can serve multiple applications, enhancing development efficiency.
  • Customize entry points based on specific application needs to streamline functionality.

Frequently Asked Questions (4)

Do I need to define separate entry points for each module in my NetSuite custom extension?
No, with the introduction of the extension framework, you can use a single entry point for an entire extension instead of separate entry points for each module. This simplifies the development process.
How can I specify multiple entry points for different site applications in NetSuite?
You can specify multiple entry points in your `manifest.json` by listing different paths for each application, such as 'shopping', 'myaccount', and 'checkout'. This allows for different code to run across various site applications.
What command should I run after updating the entry points in my manifest.json file?
After updating your entry points, run `gulp extension:update-manifest` followed by `gulp extension:local` to update your extension and test it locally.
How can I verify that my entry point configuration is working correctly in NetSuite?
You can verify the configuration by checking the developer console for output messages like 'ModuleOne loaded!' or 'ModuleTwo loaded!' This confirms that the entry points are correctly calling their respective modules.
Source: Entry Points 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 SuiteCloud Development Framework

View all SuiteCloud Development Framework articles →