When a Modify Attribute Rule is configured to hide a product attribute based on an Entity Filter condition that references a custom field on the QuoteLineItem object, the rule always executes in Standard Cart APIs — even when the Entity Filter condition evaluates to false. The attribute is incorrectly hidden regardless of the custom field value.
This behavior occurs only with Standard Cart APIs (postCartsItems). The same Entity Filter evaluation works correctly in Classic Cart APIs.
In Standard Cart APIs, QuoteLineItem custom field values may not be loaded at the time Entity Filters are evaluated during postCartsItems processing. Because the referenced custom field has no value available, the Entity Filter condition cannot evaluate to true, and the Modify Attribute Rule defaults to executing (hiding the attribute).
Use a CpqValidationHook preInvoke implementation to populate the required QuoteLineItem custom field values before Entity Filter evaluation occurs.
Step 1: Create the Hook Implementation Class
Create an Apex class that implements vlocity_cmt.VlocityOpenInterface:
global class CpqValidationHookImpl implements vlocity_cmt.VlocityOpenInterface {
global Boolean invokeMethod(String methodName, Map<String, Object> input,
Map<String, Object> output, Map<String, Object> options) {
if (methodName.equalsIgnoreCase('executeValidationRules.PreInvoke')) {
executeValidationRules_PreInvoke(input, output, options);
return true;
}
if (methodName.equalsIgnoreCase('executeValidationRules.PostInvoke')) {
executeValidationRules_PostInvoke(input, output, options);
return true;
}
return false;
}
private void executeValidationRules_PreInvoke(Map<String, Object> input,
Map<String, Object> output,
Map<String, Object> options) {
vlocity_cmt.CpqCartDocument cartDoc =
(vlocity_cmt.CpqCartDocument) input.get('cartDocument');
Map<String, Object> outputLineItems = cartDoc.call('getAllItems',
new Map<String, Object>{'hierarchyLevel' => -1});
// Populate your QuoteLineItem custom field values on each item here
}
private void executeValidationRules_PostInvoke(Map<String, Object> input,
Map<String, Object> output,
Map<String, Object> options) {
// Post-validation logic if needed
}
}
Step 2: Register the Hook Interface
Register the hook implementation through Interface Implementation:
Step 3: Activate the Hook
Step 4: Verify the Fix
005388964

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.