ConnectApi.CommerceCart.getCartItems throws an exception for WebCart records that have not been created and modified before Spring '24.
Salesforce says this works as designed.
Summary
ConnectApi.CommerceCart.getCartItems throws an exception for WebCart records that have not been created and modified before Spring '24.
This issue affects WebCart records where the TotalProductLineItemCount is blank, and either TotalProductCount or UniqueProductCount is greater than zero. These records are impacted because they haven't been created and modified since Sprint '24.
The field TotalProductLineItemCount has been introduced in Spring '24 (V60)
- https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_webcart.htm
Workaround
We haven't loaded the full details for this issue yet. Check the official page.
History
First tracked here as Working as Expected
Nov 30, 2026
Also open in B2B Commerce
Incorrect labels for Tab component on B2B Site
Solution ScheduledCommerce / B2B CommerceWinter '24Reported Jun 13, 202314 reports14reports
Custom Pricing Extension returns 18-character format for ProductID causing issues on the Product Detail page
In ReviewCommerce / B2B CommerceWinter '26Reported Sep 16, 202513 reports13reports
Various Apis and apex classes Fails with System.UnexpectedException After Winter '26 Release
In ReviewCommerce / B2B CommerceReported Sep 9, 202513 reports13reports
Images in Enhanced LWR sites do not render to Site user if Cloudflare CDN is enabled
Solution ScheduledCommerce / B2B CommerceWinter '25Reported Jan 22, 202512 reports12reports