Extend the Backend Configuration File

This topic applies to

Applies to

Denali | Mont Blanc

This section applies to pre-Vinson implementations for SuiteCommerce Advanced (SCA) only. For details on configuring SCA for Vinson release or later, see Configure Properties.

Important

Making changes to core JavaScript source files or changing any vital functionality of the application can make migrating to future releases difficult. Before making changes to SCA, see Best Practices for Customizing SuiteCommerce Advanced.


SCA uses a backend configuration file to modify the behavior of NetSuite features. See Backend Configuration for more information.

During deployment, the backend configuration file is combined and deployed as a SuiteScript library in NetSuite. Like other JavaScript customizations, the recommended best practice is to create a custom module that redefines the configuration properties that you want to modify. However, since this file is deployed as a SuiteScript library, you only add your custom module to the distro.json file as a dependency. You do not need to define the mountToApp method.

To extend the backend configuration file:

  1. Create the directory structure for your custom module.

    In this example, the name of the custom module is BackendConfigurator, so the module directory would be BackendConfigurator@1.0.0.

  2. Create the SuiteScript subdirectory in your new module directory.

    Since the backend configuration file is a SuiteScript file, this directory is required.

  3. Create a new JavaScript file in the SuiteScript directory of your custom module.

    In this example, this file is BackendConfiugrator.js

  4. Add code to redefine the backend configuration properties you want to change.

    For example, the code you add should look similar to the following:

    define('BackendConfigurator'
    , [
          'Configuration'
      ]
    , function (
          config
      )
    {
      'use strict';
      //disable CMS
      config.useCMS = false;
    });

    This example performs the following:

    • Lists the dependencies required by the custom module. When customizing the backend configuration file, the only required dependency is the Configuration object. This object is defined in the Configuration.js file located in the Modules/Ssplibraries directory of the SCA source directory.

    • Redefines a single configuration property. In this case, the custom module is setting the useCMS property to false.

  5. Create and edit the ns.package.json in the root directory of your custom module.

    Your file should contain code similar to the following:

    {
       "gulp": {
          "ssp-libraries": [
             "SuiteScript/*.js"
          ]
       }
    }
  6. Edit the distro.json file.

    You must add your custom module to the distro.json file for it to be loaded into the application. Since this module is extending an SSP library, you must add it to the following locations:

    • Add the name of your custom module to the modules array. To ensure that your customizations are not overwritten by other modules, add the custom module to the top of the array.

    • Add the name of your custom module to the dependencies array of the ssp-libraries object.

  7. View your changes.

    Since the backend configuration file is a SuiteScript file and stored as an SSP library, you must deploy your custom module directly to NetSuite to view your changes. See Deploy to NetSuite for more information.