Extend the Backend Configuration File
This example applies to pre-Vinson implementations of SuiteCommerce Advanced (SCA) only. For details about configuring SCA for Vinson or later releases, see Modify JSON Configuration Files.
Making changes to core JavaScript source files or changing vital functionality of the application can make migrating to future releases difficult. Before making changes to SCA, see Best Practices for Customizing SCA.
SCA uses a backend configuration file to modify the behavior of NetSuite features. See Extend the Backend Configuration File for more information.
During deployment, the backend configuration file is combined and deployed as a SuiteScript library in NetSuite. Like other JavaScript customizations, 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:
-
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
. -
Create the SuiteScript subdirectory in your new module directory.
Because the backend configuration file is a SuiteScript file, this directory is required.
-
Create a new JavaScript file in the SuiteScript directory of your custom module.
In this example, this file is named
BackendConfigurator.js.
-
Add code to redefine the backend configuration properties you want to change.
For example, the code you add should look similar to:
define('BackendConfigurator' , [ 'Configuration' ] , function ( config ) { 'use strict'; //disable CMS config.useCMS = false; });
This sample code 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 tofalse
.
-
-
Create and edit the the ns.package.json file in the root directory of your custom module.
Your ns.package.json file should contain code similar to:
{ "gulp": { "ssp-libraries": [ "SuiteScript/*.js" ] } }
-
Edit the distro.json file.
You must add your custom module to the distro.json file for it to be loaded into the application. Because this module is extending an SSP library, you must add it in the following locations:
-
Add the name of your custom module to the
modules
. To ensure that your customizations are not overwritten by other modules, add the custom module to the top of the . -
Add the name of your custom module to the
dependencies
of thessp-libraries
object.
-
-
View your changes.
Because 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 SCA Customizations to NetSuite for more information.
Related Topics
- Example SCA Customizations
- Create a Custom Module
- Modify JSON Configuration Files
- Extend Frontend Configuration Files
- Configure Facet Fields
- Add a Child View to a Composite View
- Override a Template File
- Extend a Sass File
- Add a Sticky Button
- Customizing the Loading Icon
- Adding a Custom Web Font
- Extending Font Awesome
- Displaying Device-Specific Carousel Images