Automate Product Relationship Management in Multi-Product Carts
Ensure order accuracy and a better configuration experience with automated product relationship actions, including Auto-Remove to maintain clean cart state by deleting dependent products when triggering conditions are not met.
Required Editions
| Available in: Classic and Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions for CME managed package |
In complex, multi-product scenarios—such as a single quote containing multiple instances of the same internet bundle—precise scoping is essential to make sure that the system only removes the specific product instance related to a configuration change.
Business Value and Benefits
Implementing granular control over product removal provides several key advantages for service providers:
- Configuration Integrity: Prevent orphan-dependent products that cause pricing errors, validation failures, and fulfillment issues.
- Reduced Complexity: Eliminate the usage of custom Apex code to handle product cleanup.
- Sales Efficiency: Enable confident quote configuration with automatic cart adjustments, removing the risk of invalid product combinations.
- Behavioral Consistency: Align Auto-Remove functionality with Auto-Add, providing a predictable administrative experience.
The effectiveness of an Auto-Remove action depends on its Context setting, which determines the scope the engine searches when identifying products to delete.
Bundle Context
When the context is set to Bundle, the Product Relationship engine restricts its search to the specific bundle instance where the change has occurred. This is the preferred setting for granular dependency management in multi-instance carts.
For example, if a customer has two identical "Dedicated Internet" bundles (Instance A and Instance B) and opts out of a security add-on for Instance A, the engine uses the triggering item, AssetReferenceId__c which is captured at Auto-Add time as ReliesOnItemId__c on the dependent item to target and remove only the security product within Instance A. Instance B remains untouched.
Cart Context (Global)
The Cart context acts as a global scope. When using Cart context, the system searches the entire cart. If you've set up a ReliesOn Product Relationship and kept the default ReliesOnCorrelation setting (True), the system only removes items linked to the specific triggering product. Otherwise, it removes all matching products from the cart.
This is typically used for global offerings that can't coexist with certain selections anywhere in the configuration.
Use Case: Multi-Instance Bundle Cleanup
Consider a scenario where a Sales Agent is configuring a quote for a business with multiple branch offices:
Action:
- Agent adds two instances of an "Internet + Managed Security" bundle to the cart (one for each branch office).
- Agent changes an attribute on the Internet product in the second bundle, making the Managed Security add-on ineligible.
Result: With Auto-Remove context set to Bundle, the system identifies the unique path of the triggering Internet product, locates the sibling Managed Security item within that specific bundle, and deletes it. The Managed Security item in the first bundle remains intact, while the second bundle is automatically cleaned up, ensuring the quote stays valid and accurately priced.
Setting: ReliesOnCorrelation on CpqConfigurationSetup__c
This custom setting controls whether Auto-Add and Auto-Remove actions apply to individual product instances or all matching products in the cart.
True (default): Auto-Add creates a link between the triggering item and the dependent item. Auto-Remove uses this link to delete only the specific dependent item, regardless of Bundle or Cart context. The link also prevents duplicate dependent items from being added.
False: Revert to legacy behavior. Skip instance linking during Auto-Add. Remove all dependent items within the configured scope during Auto-Remove.
Best Practice: Keep this setting at True. Configure a ReliesOn Product Relationship for each product pair that requires instance-scoped Auto-Add and Auto-Remove.
