Symptom
Calculate Totals fails for a change order basket with error:
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [record ID]
The error points to the Address__c field in "configurationProperties" containing an invalid Salesforce record ID.
Cause
A product configuration contains a reference to a Salesforce record (in the Address__c configuration property) that either no longer exists, is not accessible to the running user, or belongs to a different org/context. Salesforce throws INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY when it cannot access the referenced record during DML operations.
Resolution
Step 1: Identify the referenced record ID
Review the error message to identify the cross-reference ID in the error.
Step 2: Query the Solution Management database for the correlation ID
Query the Solution Management database to find the correlation ID for the failing job:
SELECT *
FROM [orgId].jobs
WHERE basket_id = '[basketId]'
ORDER BY created_at DESC;
Step 3: Check the product configurations
Query the configurations for the basket:
SELECT *
FROM [orgId].configurations
WHERE basket_id = '[basketId]'
ORDER BY created_at DESC;
Step 4: Locate the invalid configuration
Find the configuration with an Address__c property containing an invalid or inaccessible Salesforce record ID.
Step 5: Correct the Address__c value
Update the Address__c value in the configurationProperties to reference a valid, accessible record.
Step 6: Retry Calculate Totals
Retry Calculate Totals and verify it completes successfully.
How Configuration Properties Are Persisted
During Calculate Totals or solution submission, configuration properties stored in the Solution Management database are forwarded to Salesforce and persisted via an upsert on cscfga__Product_Configuration__c records. When a configuration property field (like Address__c) contains a Salesforce record ID that is deleted, inaccessible, or from a different org context, the DML operation throws INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY.
The fix requires updating the invalid record ID in the configuration's properties either through the Solution Management database directly or by re-configuring the product in the Solution Console.
Additional Notes
- This error pattern can occur with any configurationProperties field that references Salesforce record IDs (not just Address__c)
- Check sharing rules and field-level security if the record exists but is inaccessible
- Data migrations or org refreshes can introduce stale record IDs in configuration properties
Priyanka Bhotika
Comments