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. You can also use this callback to populate a selective set of parameters with corresponding values on a renewal quote (with the same data as the original quote) during renewal automation. If the user has data on the quote header that must be propagated to line items and then be used in pricing, this callback can copy those fields to the renewal quote and pricing will be accurate on the renewal quote generated.

To use the Asset Renewal Custom Callback, you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IAssetRenewalCustomCallback interface and register the custom apex class with Asset Renewal Custom Callback Class. You must write your custom logic in the custom apex class.

The following methods are available in the Apttus_Config2.CustomClass.IAssetRenewalCustomCallback interface:

getAssetFilterExpr()String getAssetFilterExpr()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.
getConfigProperties()List getConfigProperties(SObject)

You must use this method to fetch the configuration request parameters when the renewal cart is created. You can also use this method to update the proposal or agreement with default values by passing a proposal or agreement subject.

In the following sample, the assets on the renewal quote are filtered based on the product name.

global with sharing class SampleAssetRenewalCustomCallback implements Apttus_Config2.CustomClass.IAssetRenewalCustomCallback {    
     * Callback invoked to append asset filter expression to the renew asset line item query  
     * Filter expression should be created using asset line item fields only.  
     * @return the filter expression or null to use the default filter.  
    global String getAssetFilterExpr() {
        Product2 prod = [SELECT ID from Product2 where Name = 'Standalone2'];  
        return 'Apttus_Config2__ProductId__c = \'' + prod.Id + '\'';       

     * Gets the list of configuration properties for the given business SObject
     * @param bObjectSO the business Sobject to get the configuration properties for
     * @return the list of configuration properties.
    global List<Apttus_Config2.Property> getConfigProperties(SObject bObjectSO) {
        List<Apttus_Config2.Property> configProps = new List<Apttus_Config2.Property>();
        configProps.add(new Apttus_Config2.Property('flow', 'LAngFlow'));
        configProps.add(new Apttus_Config2.Property('useAdvancedApproval', 'false'));
        configProps.add(new Apttus_Config2.Property('useDealOptimizer', 'false'));
        return configProps;