Start a conversation

Sales Console and Solution Manager Errors After Package Upgrade Due to getConfigurations() API Misuse

Symptom

After upgrading to R37 (or later), Sales Console and Solution Manager stop working. The application may throw errors or behave unexpectedly when interacting with configurations.

Cause

Custom plugin code assumes getConfigurations() returns an array or list and indexes it with [0]. The getConfigurations() API actually returns a dictionary (object) keyed by configuration GUIDs. Indexing with [0] returns undefined, causing the application to fail.

Resolution

Step 1: Locate the problematic code

Search your custom plugin code for solution.getConfigurations()[0] or similar patterns that index the result of getConfigurations().

Step 2: Remove the array index

Remove [0] from solution.getConfigurations()[0]. The getConfigurations() API returns a dictionary of configurations keyed by GUIDs, not a list.

Step 3: Use the correct iteration pattern

To iterate over configurations, use Object.keys() or Object.values():

// Example: iterate over configurations
var configs = solution.getConfigurations();
Object.keys(configs).forEach(function(guid) {
  var config = configs[guid];
  // process config
});

Or:

Object.values(configs).forEach(function(config) {
  // process config
});

Step 4: Test the fix

Verify that Sales Console and Solution Manager function correctly after the code change.

Additional Notes

  • The Solution Manager (SM) Javascript API guide documents that getConfigurations() returns a dictionary of configurations keyed by GUIDs.
  • This issue typically surfaces after package upgrades when API behavior changes or when stricter validation is enforced.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments