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.

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.

You can control Revalidation feature by using config system properties with setting name EnableRevalidationOnPricing to True.

To use the Revalidation Callback you must create a custom C# that implements the IRevalidationCallback interface and register the custom C# with Revalidation Callback Class. You must write your custom logic in the custom C#.

The following methods are available in the IRevalidationCallback interface:

Method

Signature

Description

GetRevalidationDetailAsync()GetRevalidationDetailAsync(IActionRequest 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.

GetApplyRevalidationDetailAsync()GetApplyRevalidationDetailAsync(IActionRequest 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.

Example

The below-given code example checks if the quantity of line items is greater then 10 then triggers the revalidation on the cart, revalidates the line item and resets the quantity of the line items.

using Conga.Revenue.Common.Callback.Messages;
using System.Threading.Tasks;

namespace Conga.Revenue.Common.Callback
{
    /// <summary>
    /// IRevalidationCallback: Revalidation callback hookpoint
    /// </summary>
    public interface IRevalidationCallback
    {
        /// <summary>
        /// This hookpoint is used to write get revalidation callback code.
        /// </summary>
        /// <param name="revalidationRequest">revalidationRequest</param>
        public Task GetRevalidationDetailAsync(IActionRequest revalidationRequest);

        /// <summary>
        /// This hookpoint is used to write get apply revalidation callback code.
        /// </summary>
        /// <param name="revalidationRequest">revalidationRequest</param>
        /// <returns></returns>
        public Task GetApplyRevalidationDetailAsync(IActionRequest revalidationRequest);
    }
}
CODE