Asset Renewal Custom Callback Class
Asset Renewal Custom Callback allows you to filter the renewal quote assets that are created using the On-Demand job. For example, you can filter assets by Product Name as a filter criteria.
To use the Asset Renewal Custom Callback, you must create a custom C# class that implements the IAssetRenewalCustomCallback interface and register the custom apex class with Asset Renewal Custom Callback Class. You must write your custom logic in the custom C# class.
The following methods are available in the IAssetRenewalCustomCallback interface:
Method |
Signature |
Description |
---|---|---|
GetFilterExpression |
string GetFilterExpression() |
You must use this method to append custom filters to the on-demand asset query when the asset line items are fetched from the on-demand renewal quote. If there are no additional filters (other than the standard filters), return null. |
The following is an example of the custom logic you can implement using asset filter example.
using System;
using System.Linq;
using Conga.Revenue.Common.Callback.Models;
using Conga.Platform.Extensibility.CustomCode.Library;
using System.Collections.Generic;
using System.Threading.Tasks;
using Conga.Revenue.Common.Callback;
using Conga.Revenue.Common.Callback.Entities;
using Conga.Revenue.Common.Callback.Messages;
using Conga.Platform.Extensibility.CustomCode.Library.Interfaces;
namespace SSAssetRenewOnDemandCallback
{
/// <summary>
/// Asset RenewOnDemandCallback Callback
/// </summary>
public class AssetRenewalCallback : CodeExtensibility, IAssetRenewalCallback
{
/// <summary>
/// GetFilterExpression
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<string> GetFilterExpression()
{
var logHelper = GetLogHelper();
var dbHelper = base.GetDataHelper();
using var span = base.GetTelemetryHelper().StartActiveSpan("ValidateAssetTermination");
try
{
logHelper.LogInformation("GetFilterExpression started");
// return "(Quantity >= 1)";
return "(Product.Name = 'SS ABO Standalone UsagePdt01')";
}
catch (Exception ex)
{
logHelper.LogInformation("GetFilterExpression Exception");
return ex.Message;
}
}
}
}