Problem
When attempting to open a MACD basket for a specific solution, the Solution Console fails to load with a JavaScript error. This typically occurs when:
- You click "Change Solution" on an existing subscription or solution
- The MACD basket is created, but the Solution Console page buffers indefinitely
- The browser console shows the error:
TypeError: Cannot read properties of undefined (reading 'productOptionType') - The error occurs at
BasketUtils.generateRelatedProductorBasketUtils.createSolutionFromDBAttachment
The issue affects all MACD operations for the specific solution, preventing any changes or modifications.
Root Cause
The issue is caused by an incorrect Solution Definition hierarchy where a Custom Component (typically the "Overview" tab) has its Parent Component field populated when it should be blank.
Detailed explanation:
CloudSense Solution Definitions use a hierarchical structure where:
- Main Component: The root component that contains all other components
- Child Components: Components that have a Parent Component (e.g., product options, related products, add-ons)
- Custom Components: Special components like "Overview", "Pricing", "Technical Details" that should sit at the top level of the solution (no parent)
When the Solution Console rebuilds the component tree from solutiondetails.json, it expects:
- Custom Components with Component Type = Overview to be at the root level (Parent Component = blank)
- All other components to have a valid Parent Component
What goes wrong:
1. The "Overview" Custom Component record has its Parent Component field populated (e.g., pointing to the Main Component)
2. When the Solution Console renders the basket, it treats "Overview" as a child node instead of a root node
3. The JavaScript code that builds the component tree expects "Overview" to be at the root level and fails when it tries to access properties that don't exist for child nodes
4. The error Cannot read properties of undefined (reading 'productOptionType') is thrown, preventing the basket from loading
Common scenarios:
- Solution Definition was edited manually and the Parent Component field was accidentally populated
- Solution Definition was cloned from another definition and the hierarchy was not corrected
- Solution Definition was imported from another org with incorrect hierarchy
- Bulk updates to Solution Definition records inadvertently set the Parent Component field
Resolution Steps
Step 1: Identify the Problematic Solution Definition Record
-
Note the solution ID reported by the customer (e.g.,
a4fOY0000024KqDYAU) -
Query the Solution Definition records to find the "Overview" component with an incorrect Parent Component:
SELECT Id, Name, cssdm__Type__c, cssdm__Component_Type__c,
cssdm__Parent_Component__c, cssdm__Main_Component__c,
cssdm__Product_Definition__c
FROM cssdm__Solution_Definition__c
WHERE (Id = '[Main Component ID]'
OR cssdm__Main_Component__c = '[Main Component ID]')
AND cssdm__Type__c = 'Custom Component'
AND cssdm__Component_Type__c = 'Overview'
AND cssdm__Parent_Component__c != NULL
Note: Replace [Main Component ID] with the Main Component ID from the solution. You can find this by querying:
SELECT cssdm__Main_Component__c
FROM csord__Solution__c
WHERE Id = 'a4fOY0000024KqDYAU'
- Expected result: One or more records where:
cssdm__Type__c= "Custom Component"cssdm__Component_Type__c= "Overview"-
cssdm__Parent_Component__cis not null (this is the problem) -
Note the record ID (e.g.,
aAGOY000000B2RX4A0)
Step 2: Correct the Solution Definition Hierarchy
-
Navigate to Setup > Object Manager > Solution Definition
-
Find the record by ID (e.g.,
aAGOY000000B2RX4A0) -
Edit the record and clear the Parent Component field:
- Set
Parent Componentto blank (remove any value) - Leave
Type= "Custom Component" as is - Leave
Component Type= "Overview" as is -
Click Save
-
Verify the correction:
SELECT Id, Name, cssdm__Type__c, cssdm__Component_Type__c,
cssdm__Parent_Component__c
FROM cssdm__Solution_Definition__c
WHERE Id = 'aAGOY000000B2RX4A0'
- Expected result:
cssdm__Parent_Component__cshould now be null
Step 3: Verify the MACD Basket Loads Successfully
- Clone or create a fresh MACD basket for the solution:
- Navigate to the subscription or solution record
-
Click Change Solution or Create MACD Opportunity
-
Open the MACD basket in the Solution Console
-
Verify the basket loads without errors:
- The Solution Console should display the basket without buffering
- No JavaScript errors should appear in the browser console
- The "Overview" tab should be visible at the top level
-
All configurations should be visible and editable
-
Test the basket save operation:
- Make a small change to the basket (e.g., update a quantity)
- Click Calculate Totals
- Verify the basket saves successfully
Step 4: Validate the Fix with a Query
Run the following query to confirm there are no remaining hierarchy issues:
SELECT Id, Name, cssdm__Type__c, cssdm__Component_Type__c,
cssdm__Parent_Component__c, cssdm__Product_Definition__c
FROM cssdm__Solution_Definition__c
WHERE (Id = '[Main Component ID]'
OR cssdm__Main_Component__c = '[Main Component ID]')
AND cssdm__Type__c = 'Custom Component'
AND cssdm__Component_Type__c = 'Overview'
AND cssdm__Parent_Component__c != NULL
Expected result: Zero rows returned (no "Overview" components with a Parent Component)
Step 5: Notify the Customer
- Provide confirmation to the customer:
We have identified and resolved the issue preventing the MACD basket from loading for solution [Solution ID].
The root cause was an incorrect Solution Definition hierarchy where the "Overview" Custom Component had its Parent Component field populated when it should be blank. We have corrected the hierarchy and verified that MACD baskets now load successfully.
Please verify that you can now create MACD baskets for this solution and proceed with your workflow.
-
Ask the customer to verify the MACD basket loads correctly
-
Close the ticket once the customer confirms the fix
Prevention
To prevent this issue in future Solution Definition management:
Implement a Validation Rule
Create a validation rule that blocks any record where:
- Type = "Custom Component"
- Component Type = "Overview"
- Parent Component ≠ blank
Validation Rule Formula:
AND(
ISPICKVAL(cssdm__Type__c, "Custom Component"),
ISPICKVAL(cssdm__Component_Type__c, "Overview"),
NOT(ISBLANK(cssdm__Parent_Component__c))
)
Error Message:
Overview Custom Components must not have a Parent Component.
Please clear the Parent Component field to maintain correct hierarchy.
Additional Prevention Measures
- Document the Solution Definition hierarchy for your team to understand which components should be at the root level
- Test MACD operations after editing Solution Definitions to identify hierarchy issues early
- Use the Solution Definition Editor UI instead of manually editing records to avoid hierarchy errors
- Implement a pre-deployment validation that checks for incorrect hierarchies before migrating Solution Definitions to production
- Audit existing Solution Definitions periodically to identify and correct hierarchy issues
- Train team members on the correct hierarchy structure for Custom Components
Audit Existing Solution Definitions
Run this query to identify any existing hierarchy issues:
SELECT Id, Name, cssdm__Type__c, cssdm__Component_Type__c,
cssdm__Parent_Component__c, cssdm__Product_Definition__c,
cssdm__Product_Definition__r.Name
FROM cssdm__Solution_Definition__c
WHERE cssdm__Type__c = 'Custom Component'
AND cssdm__Component_Type__c = 'Overview'
AND cssdm__Parent_Component__c != NULL
Expected result: Zero rows (no "Overview" components with a Parent Component)
If any rows are returned, correct them using the steps in this article.
Verification
After completing the resolution steps:
-
Create a new MACD basket from the solution and verify it loads without errors
-
Check the browser console for any JavaScript errors (should be none)
-
Test the full MACD workflow:
- Add/remove components
- Click Calculate Totals
- Submit the basket
-
Verify the order is generated successfully
-
Run the validation query to confirm no hierarchy issues remain
Important Notes
- The error message "Cannot read properties of undefined (reading 'productOptionType')" is a generic JavaScript error that can have multiple root causes; always verify the Solution Definition hierarchy first
- The issue only affects MACD baskets; new baskets created from scratch may work fine
- Multiple Custom Components may have incorrect hierarchies; audit all Custom Components in the Solution Definition
- If the issue persists after correcting the hierarchy, check for other data integrity issues (e.g., missing component records, invalid GUIDs)
- The validation rule will prevent future occurrences but will not automatically fix existing records
- Always test the fix in a sandbox environment before applying to production
- If you have multiple solutions using the same Product Definition, they will all be affected by the same hierarchy issue
- The Solution Definition Editor UI should prevent this issue from occurring, but manual edits or imports may bypass the validation
Priyanka Bhotika
Comments