Product Filter Callback provides you a mechanism to control the visibility of products on the catalog page based on custom criteria that you define. You can define entry criteria to determine whether a product in a price list should be filtered to a certain subset of the full list. You can define the criteria to select standalone products and option products as well. When you click Configure Products from a Quote/Proposal or Add More Products from the Cart, the CPQ checks whether the criteria are applicable for the specific price list.

To use the Product Filter Callback you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IProductFilterCallback interface and register the custom apex class with Product Filter Callback Class. You must write your custom logic in the custom apex class.

The following methods are available in the Apttus_Config2.CustomClass.IProductFilterCallback interface:

MethodSignatureDescription
getOptionFilterExpr()

String getOptionFilterExpr(Apttus_Config2.CustomClass.ActionParams)

You can use this method to control the visibility of option on the Catalog page.
getProductFilterExpr()String getProductFilterExpr(Apttus_Config2.CustomClass.ActionParams)

You can use this method to control the visibility of Stanalone and bundle products on the Catalog page.


Example

This is just a sample callback custom class to control the visibility of products on the Catalog page. The following only filter the Catalog products having color Red and the options products having color Green. You may change the custom class to fit your business requirements.

global with sharing class SampleProductFilterCallback implements Apttus_Config2.CustomClass.IProductFilterCallback {
    /**
     * Callback to return part of SOQL filter clause
     * This filter is used in listing catalog products
     * @param params is the Apttus_Config2.CustomClass.ActionParams that 
     * contains accountIds, locationIds when available 
     * @return The query filter is like the following.
     * Name LIKE 'A%' AND Quantity__c > 100
     * Id IN ('000123', '000124') 
     */
    global String getProductFilterExpr(Apttus_Config2.CustomClass.ActionParams params) {
       return 'Color__c = \'Red\''; 
    }
 
    /**
     * Callback to return part of SOQLfilter clause
     * This filter is used in listing option products
     * @param parsms is the CustomClass.ActionParams that contains accountIds, locationIds when available 
     * @return The query filter is like the following.
     * Name LIKE 'A%' AND Quantity__c > 100
     * Id IN ('000123', '000124') 
     */
    global String getOptionFilterExpr(CustomClass.ActionParams params) {
        return 'ComponentProductId__r.Color__c =\'Green\'';
    }
}

CODE