Revalidation Callback Class
Revalidation Callback provides you a mechanism to implement custom revalidations for products based on custom criteria. You can define custom criteria based on which the products are identified by CPQ for revalidation. The callback allows you to define a custom logic to be applied on the line item along with revalidation. You can also define a custom product version when the line item is created.
To use the Revalidation Callback you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IRevalidationCallback interface and register the custom apex class with Revalidation Callback Class. You must write your custom logic in the custom apex class.
The following methods are available in the Apttus_Config2.CustomClass.IRevalidationCallback interface:
Method | Signature | Description |
---|---|---|
getRevalidations() | Apttus_Config2.CustomClass.RevalidationResponse getRevalidations(Apttus_Config2.CustomClass.RevalidationRequest) | You can use this method to determine whether the line item requires revalidation based on a custom logic that you can define. This method is invoked when you reconfigure a save or finalized cart. |
setRevalidations() | void setRevalidations(Apttus_Config2.CustomClass.RevalidationRequest) | You can use this method write custom logic to apply on line items. This method is invoked when you click Apply Revalidation on the Revalidation pop-up. |
setVersionNumber() | void setVersionNumber(Id, List) | You can use this method to set the version number field of the line item with custom value based on custom logic you define. This method is invoked when you add line items to the cart. |
Example
You can use this callback to a scenario like:
- You can have multiple versions for a single product record. This enables you to revalidate a specific version of the product as necessary.
For example, for product record, you can set the version as X, Y, and any such value for the newly created line item of that product. You can determine which line item qualifies for revalidation and apply custom logic on the line items accordingly.
- You can apply validation based custom fields other than the Product Version.
- You can validate changes in pricing fields like List price of a given price list item.