Overview
Order generation can be blocked when CloudSense logs show "Product Configuration count mismatch for basket <basket_id>" (and/or "There is a Product Configuration mismatch found in CS Error Log and Order did not get generated.").
This typically occurs when a basket contains orphaned snapshot records in Product_Basket_Snapshot__c while the corresponding cscfga_Product_Configuration__c (PC) records are missing, creating a snapshot vs. configuration count mismatch.
Solution
Error message(s)
"Product Configuration count mismatch for basket <basket_id>""There is a Product Configuration mismatch found in CS Error Log and Order did not get generated."
Symptoms / impact
- Order does not generate for the basket (even if the opportunity/order process has progressed, such as being marked Closed Won).
- Record counts differ between:
Product_Basket_Snapshot__c(snapshots)cscfga_Product_Configuration__c(product configurations)
Root cause
A data integrity mismatch exists in the basket where snapshots exist but the corresponding PC records do not:
- Snapshot records were created for a PC (example: Customer Provided Internet (MB632335), GUID
<pc_guid>) and its children (<child_guid_1>,<child_guid_2>). - The corresponding
cscfga_Product_Configuration__crecords are missing. - This causes a snapshot vs. configuration record count mismatch, which blocks order generation.
Investigation approach (what to check)
- Locate the basket referenced in the error log (
<basket_id>). - Compare record counts for the same basket between:
Product_Basket_Snapshot__ccscfga_Product_Configuration__c
- Identify GUIDs that exist in snapshots but do not have matching PC records.
- Confirm the affected PCs were not modified (dirty flag is
false) before removing snapshot data.
Mitigation / resolution (data cleanup)
If the affected PCs are not modified (dirty flag = false), delete the orphaned snapshot records for the impacted GUIDs in the basket.
Example SOQL (replace placeholders as appropriate):
select id, Name, Product_Definition_Name__c, GUID__c
from Product_Basket_Snapshot__c
where Product_Basket__c = '<basket_id>'
and GUID__c IN ('<child_guid_1>',
'<child_guid_2>',
'<pc_guid>')
Delete the returned Product_Basket_Snapshot__c records using a method aligned with your operational practices (for example, Data Loader, Workbench, or other approved tooling).
Validation (confirm it’s resolved)
- Re-check that snapshot vs. PC counts now align for the basket.
- Re-attempt order generation for the same basket.
- Confirm the original error no longer appears in
CS_Error_Log__cfor that basket and that the order is generated successfully.
Notes / cautions
- Only remove snapshot records that are confirmed orphaned (snapshot exists, PC record missing) and confirmed not modified (dirty flag =
false). - If the PCs appear modified (dirty flag =
true) or you cannot confirm the state safely, pause and investigate further to avoid unintended loss of user changes. - In one confirmed instance, this mismatch was reproduced and validated in a PROD Salesforce org (
<org_id>) where snapshots existed but PC records were missing for GUID<pc_guid>and children<child_guid_1>,<child_guid_2>.
Frequently Asked Questions
- 1. How do I know I’m hitting this exact issue?
- You’ll see
"Product Configuration count mismatch for basket <basket_id>"in logs (for example,CS_Error_Log__c) and order generation fails. You’ll also observe different record counts betweenProduct_Basket_Snapshot__candcscfga_Product_Configuration__cfor the same basket. - 2. What’s the most common underlying cause?
- Orphaned
Product_Basket_Snapshot__crecords exist for one or more GUIDs, but the correspondingcscfga_Product_Configuration__crecords are missing, creating a count mismatch that blocks order generation. - 3. What should I delete to fix it?
- Delete only the orphaned
Product_Basket_Snapshot__crecords for the GUIDs that have snapshots but no matching PC records—provided the related PCs were not modified (dirty flagfalse). Use a SOQL query scoped to the basket (Product_Basket__c = '<basket_id>') and the identified GUID list. - 4. How do I verify the fix worked?
- After deleting the orphan snapshots, confirm snapshot and PC counts align for the basket, then rerun order generation. The error should no longer appear in
CS_Error_Log__c, and the order should be generated. - 5. What if deleting snapshot records doesn’t resolve the mismatch?
- Re-check for additional GUIDs where snapshots exist but PCs are missing (the initial GUID list may not be exhaustive). If mismatches persist or the dirty flag indicates modified records, perform deeper investigation before further deletion to avoid removing valid snapshot history.
Matej Storga
Comments