Asset filter callback provides you a mechanism to define the criteria based on which you want to filter assets on the Installed Product page. The asset line items on the Installed product page are shown according to the business logic defined in the asset filter callback class. You can further filter the asset on the Installed Products page using the filters on the page.
To use the Asset filter callback you must create a custom C# class that implements the IAssetFilterCallback interface and register the custom C# class with Asset Filter Callback Class. You must write your custom logic in the custom C# class.
The following methods are available in the IAssetFilterCallbackinterface:
The following is an example of the custom logic you can implement using asset filter example.
Example
using Conga.Revenue.Common.Callback.Messages;
using System.Threading.Tasks;
namespace Conga.Revenue.Common.Callback
{
/// <summary>
/// This interface defines extension points for Asset Filter Callback
/// </summary>
public interface IAssetFilterCallback
{
/// <summary>
/// Callback to return filter expression which will be used to filter asset line items
/// </summary>
/// <param name="assetFilterCallbackRequest">List of account Ids passed as search parameter</param>
/// <returns> filter expression </returns>
Task<string> GetFilterExpression(IAssetFilterCallbackRequest assetFilterCallbackRequest);
/// <summary>
/// Callback to validate asset termination
/// </summary>
/// <param name="assetTerminateCallbackRequest"> List of asset ids, account ids and termination date</param>
/// <returns>
/// Validation message to be shown to the user, If termination date is invalid and termination can't be proceeded
/// Empty string, if termination date is valid and termination can be proceeded.
/// </returns>
Task<string> ValidateAssetTermination(IAssetTerminateCallbackRequest assetTerminateCallbackRequest);
}
}