The SuiteCommerce Configuration is a record in your NetSuite account that lets you configure properties without customizing source code. You access the record through NetSuite to configure common properties and modify application behavior for a specified domain. For more information about this record, see Configure Properties.
The SuiteCommerce Configuration record is part of the SuiteCommerce Configuration SuiteApp.
You can build your extension to access any configuration property value for the associated domain using the
getConfig(key) method of
key parameter is the ID of a property in the configuration record. The method returns a string, array, object, or Boolean, depending on the configuration property. For more information about the configuration properties and their respective IDs, see Configuration Properties Reference.
The following example shows how to use the
getConfig(key) method to access the value of the
var environmentComponent = container.getComponent('Environment');
var skipLogin = environmentComponent.getConfig('checkoutApp.skipLogin');
In the above example, the
skipLogin variable can be
false, depending on whether the Skip Checkout Login property is enabled for the domain.
Guidelines for getConfig(key)
Read and understand the following guidelines when working with the
You can use dot-notation to access the hierarchy of configuration properties. For example, using
skipLogin property value.
You can also access the hierarchy of configuration properties by string value or by name. All three of the following API calls return the value of the
getConfig() method returns a copy of the configuration or configuration property. As a result, values for configuration properties are read-only. To make changes to a configuration property, you must change the property using the SuiteCommerce Configuration record. See Site Configuration for details.
Obtain the Entire Configuration Object