Creating Entry Point Files for SuiteCommerce Modules

Entry point files are essential for SuiteCommerce modules, connecting them to the application and enabling functionality.

·2 min read·View Oracle Docs

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:

  1. 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
  2. Define Entry Point Dependencies
    Include all necessary dependencies in your file.
    JavaScript Example:

    javascript
    undefined

define(
'SC.CCT.ImageViewer',
[
'SC.CCT.ImageViewer.View'
],
function (
SCCCTImageViewerView
)

javascript
**TypeScript Example:**
```typescript
/// <amd-module name="SC.CCT.ImageViewer"/>
"text-purple-400">import SCCCTImageViewerView = "text-purple-400">require('./SC.CCT.ImageViewer.View');
  1. Create the mountToApp() Method
    This method initializes your CCT module, making it available in the application. It includes the getComponent('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:
    javascript
    1{
    2 'use strict';
    3 //@"text-purple-400">class SC.CCT.ImageViewer
    4 "text-purple-400">return {
    5 mountToApp: "text-purple-400">function mountToApp (application)
    6 {
    7 application.getComponent('CMS').registerCustomContentType({
    8 id: 'sc_cct_imgageviewer',
    9 view: SCCCTImageViewerView
    10 });
    11 }
    12 };
    13});

    TypeScript Example:

    typescript
    1{
    2 'use strict';
    3 //@class SC.CCT.ImageViewer
    4 export function mountToApp(application) {
    5 application.getComponent('CMS').registerCustomContentType({
    6 id: 'sc_cct_imgageviewer',
    7 view: SCCCTImageViewerView
    8 });
    9 }
    10};
  2. 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.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Is it possible to use TypeScript for creating entry point files in SuiteCommerce?
Yes, you can create entry point files using either JavaScript or TypeScript, depending on your project needs.
Where should the entry point file be located for a SuiteCommerce module?
The entry point file must be placed in the JavaScript directory of your Custom Content Type (CCT) module.
Do I need to register my custom content type in the SuiteCommerce Advanced architecture?
Yes, you must include the `getComponent('CMS').registerCustomContentType()` function within the `mountToApp()` method to register your custom module in Site Management Tools (SMT).
Can I modify the default SC.CCT.Html module when implementing my custom entry point file?
No, you should not alter the default SC.CCT.Html module since it connects the SCA application to core content types in SMT.
Source: Create an Entry Point File 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 →