Create an Entry Point JavaScript File

This topic applies to

Applies to

SuiteCommerce Advanced



The module source files for SuiteCommerce Advanced 2019.1 and earlier are JavaScript files with .js filename extensions. The module source files for SuiteCommerce Advanced 2019.2 and later are TypeScript files with .ts filename extensions. For more information about TypeScript, see TypeScript.

The entry point file is necessary to mount your module to the application. This provides the connection between SuiteCommerce Advanced (SCA) and Site Management Tools. For more information on the architecture and purpose of this file, see Entry Point.

To create the entry point:

  1. In your CCT module’s JavaScript directory, create a new .js file.

  2. Name this file to intuitively relate to your module.

    JavaScript example:


    TypeScript example:


  3. Define your entry point dependencies. This includes the view that you create later.

    JavaScript example:

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

    TypeScript example:

    /// import SCCCTImageViewerView = require('./SC.CCT.ImageViewer.View');
  4. Create the mountToApp() method.

    This method is required to initialize your CCT module, making it available to the application. Wrapped inside the mountToApp method is getComponent(‘CMS’).registerCustomContentType(), which passes the id and view variables to SMT:

    • The id variable loads the CMS Content Type record, connecting your module to the CCT and making your CCT available in Site Management Tools.


      The value of the id variable must match the Name field of the CMS Content Type record, and it must be all lowercase. See CMS Content Type Record for details.

    • The view variable initializes the view.

    In the following examples, the id variable is ‘sc_cct_imgageviewer’, which matches the CMS Content Type record’s Name field.

    JavaScript example:

    { 'use strict'; //@class SC.CCT.ImageViewer return { mountToApp: function mountToApp (application) { application.getComponent('CMS').registerCustomContentType({ id: 'sc_cct_imgageviewer' , view: SCCCTImageViewerView }); } }; });

    TypeScript example:

    { 'use strict'; //@class SC.CCT.ImageViewer export function mountToApp(application){ application.getComponent('CMS').registerCustomContentType({ id: 'sc_cct_imgageviewer' , view: SCCCTImageViewerView }); } };
  5. Save the file.


Your SCA source code includes a module named SC.CCT.Html. This module connects your SCA application to the four core CCTs that come with the Site Management Tools SuiteApp. Do not customize or alter the contents of this module.