Product Attribute Callback Class
Product Attribute Callback allows you to set the default value of the product attributes based on custom logic at run-time. The callback is invoked when you open the Configuration page to select attributes and options for the products.
To use the Product Attribute Callback you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IProductAttributeCallback interface and register the custom apex class with Product Attribute Callback Class. You must write your custom logic in the custom apex class.
The following methods are available in the Apttus_Config2.CustomClass.IProductAttributeCallback interface:
Method | Signature | Description |
---|---|---|
finish() | void finish() | This the last method that is executed after the callback is invoked. |
setDefaults() | void setDefaults(Apttus_Config2.LineItem, Apttus_Config2__ProductAttributeValue__c) | You can use this method to set the default value of product attributes. This method is invoked only when you enable Has Attribute field for the product. |
start() | void start(Apttus_Config2.ProductConfiguration) | This is the first method that is executed when the callback is invoked. |
You must enable Has Attribute field in product details. Otherwise, when the callback is invoked, only the start() and finish()methods are called and the callback does not set the default values for product attributes.
Example