Creating Entry Point Files for SuiteCommerce Modules
Entry point files are essential for SuiteCommerce modules, connecting them to the application and enabling functionality.
The entry point file plays a crucial role in integrating your module with the SuiteCommerce Advanced (SCA) and Site Management Tools (SMT). It establishes the necessary connection for modules to function correctly within the SCA architecture.
Key Aspects of Entry Point Files
- The entry point file can be created as either a JavaScript or TypeScript file depending on your project needs.
- The file must be created in the JavaScript directory of your CCT module.
Steps to Create the Entry Point File:
-
Create a New JavaScript or TypeScript File
Place the file in your CCT module's JavaScript directory, naming it intuitively to represent your module.
Examples:- JavaScript:
../SC.CCT.ImageViewer@0.0.1/JavaScript/SC.CCT.ImageViewer.js - TypeScript:
../SC.CCT.ImageViewer@0.0.1/JavaScript/SC.CCT.ImageViewer.ts
- JavaScript:
-
Define Entry Point Dependencies
Include all necessary dependencies in your file.
JavaScript Example:javascriptundefined
define(
'SC.CCT.ImageViewer',
[
'SC.CCT.ImageViewer.View'
],
function (
SCCCTImageViewerView
)
**TypeScript Example:** ```typescript /// <amd-module name="SC.CCT.ImageViewer"/> import SCCCTImageViewerView = require('./SC.CCT.ImageViewer.View'); -
Create the
mountToApp()Method
This method initializes your CCT module, making it available in the application. It includes thegetComponent('CMS').registerCustomContentType()function, which registers your module in SMT.- ID Variable: Should correspond to the CMS content type, in lowercase.
- View Variable: Initializes the view for your module.
JavaScript Example:
javascript1{2 'use strict';3 //@class SC.CCT.ImageViewer4 return {5 mountToApp: function mountToApp (application)6 {7 application.getComponent('CMS').registerCustomContentType({8 id: 'sc_cct_imgageviewer',9 view: SCCCTImageViewerView10 });11 }12 };13});TypeScript Example:
typescript1{2 'use strict';3 //@class SC.CCT.ImageViewer4 export function mountToApp(application) {5 application.getComponent('CMS').registerCustomContentType({6 id: 'sc_cct_imgageviewer',7 view: SCCCTImageViewerView8 });9 }10}; -
Save the File
Important Notes:
- Your source code must not alter the default SC.CCT.Html module as it connects the SCA application to core content types in SMT.
Related Topics:
- [Create Custom Content Types for SMT]
- [Create a Custom Module for Your CCT]
- [Create a View File]
- [Set Up Your ns.package.json and distro.json Files]
This comprehensive guide on creating entry point files ensures you efficiently connect your SuiteCommerce modules within the SCA framework, facilitating smoother implementation and integration.
Frequently Asked Questions (4)
Is it possible to use TypeScript for creating entry point files in SuiteCommerce?
Where should the entry point file be located for a SuiteCommerce module?
Do I need to register my custom content type in the SuiteCommerce Advanced architecture?
Can I modify the default SC.CCT.Html module when implementing my custom entry point file?
Was this article helpful?
More in Commerce
- Available Items Only Feature in NetSuite 2026.1
Available items only filtering boosts sales efficiency in NetSuite 2026.1 with Intelligent Item Recommendations.
- SuiteCommerce Updates in NetSuite 2026.1 Release Notes
SuiteCommerce, MyAccount, and Advanced updates introduced in NetSuite 2026.1 enhance eCommerce capabilities and require migration for SCA.
- New SuiteCommerce Features in NetSuite 2026.1
New SuiteCommerce features in NetSuite 2026.1 enhance user experience and improve eCommerce efficiency. Introduction Introduction
- Commerce Extensions in NetSuite 2026.1
Commerce Extensions in NetSuite 2026.1 enhance performance and user experience in eCommerce. Introduction Introduction Introduction
