getConfig Method Guidelines for SuiteCommerce Configuration
Understand the getConfig method for SuiteCommerce, emphasizing read-only values and best usage practices.
The getConfig(key) method is essential for accessing configuration properties within SuiteCommerce. Here are some crucial guidelines on how to use this method effectively:
Dot-Notation
You can easily access the hierarchy of configuration properties using dot-notation. For instance, calling getConfig('checkoutApp') will yield a JavaScript object that contains the skipLogin property value. The following API calls all retrieve the value of the skipLogin property:
getConfig('checkoutApp.skipLogin')getConfig('checkoutApp').skipLogingetConfig().checkoutApp.skipLoginRead-Only Values
It’s important to note that the getConfig() method returns a copy of the configuration or configuration property, meaning that the values are read-only. If you wish to modify a configuration property, you'll need to do so through the SuiteCommerce Configuration record. For guidance, refer to the Site Configuration documentation.
Avoid Using getConfig() Without a Key
Although using getConfig() without specifying a key is an option, it’s generally discouraged. Without a key, the application attempts to return the entire configuration object, which may result in an excessively large object on certain pages, potentially causing an internal error (e.g., InternalError: too much recursion) or a range error (e.g., RangeError: Maximum call stack size exceeded).
By following these guidelines, you can effectively utilize the getConfig() method while avoiding common pitfalls associated with read-only values and overloading the configuration object.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Can I modify configuration properties retrieved using the getConfig method in SuiteCommerce?
What happens if I use getConfig() without specifying a key?
Is dot-notation supported when accessing configuration properties with getConfig?
Why is it advised to avoid using getConfig() without a key in SuiteCommerce?
Was this article helpful?
More in General
- Field Service Management Enhancements and Bug Fixes for 2026
Overview of the 2026 Field Service Management SuiteApp updates showcasing enhancements and bug fixes.
- Example
Documentation article about Example
- Pass String Literals
Documentation article about Pass String Literals
- Manual Edits
Documentation article about Manual Edits
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category