Recommendation Callback provides you a mechanism to define products in the recommended products lists in addition to the products defined by the recommendation type constraint rules. This callback is invoked when constraint rules are executed on the Catalog page if the setting Show Recommended Products Cart View is enabled in Config Select Products Settings. After execution, Sales Rep sees the recommended products in the Recommendation popup.

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

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

MethodSignatureDescription
getRecommendedProducts()List getRecommendedProducts(Apttus_Config2.ProductConfiguration)You can use this method to define and recommend products. You must take into consideration the effective price list of the Quote. If the recommended product is not part of the price list in effecting for the quote, Sales Rep is not allowed to use those products in any operation.


Example

The given code example defines a product for recommendation.

global with sharing class SampleRecommendationCallback implements Apttus_Config2.CustomClass.IRecommendationCallback 
{

    global List<Apttus_Config2.CustomClass.RecommendationInfo> getRecommendedProducts(Apttus_Config2.ProductConfiguration cart) 
	{
		Apttus_Config2.CustomClass.RecommendationInfo recommendedProduct = new Apttus_Config2.CustomClass.RecommendationInfo('a0S0B000004JrYF', 'Relevance'); 
	
		// product ID, relevance
		
    	return new List<Apttus_Config2.CustomClass.RecommendationInfo>{recommendedProduct};
    }
}
CODE