By default, the assets that CPQ displays on the Installed Products page are from a single account related to the current quote. As an administrator, you can configure CPQ to display assets from multiple accounts, which are related to an opportunity, on the Installed Products page. You must complete the following configurations to display assets from multiple accounts:

  1. Enable the admin setting APTS_EnableInstallBaseFilteringAcrossAccounts.
  2. Configure a custom callback class.

To enable asset filtering across accounts

  1. Go to All Tabs > Admin.
  2. Click New to create a new record. The New Admin page is displayed.
  3. Fill in the following details:

    FieldValue
    NameAPTS_EnableInstallBaseFilteringAcrossAccounts
    Value

    Enter one of the following values:

    • true: CPQ displays assets from multiple accounts. 
    • false: This is the default value. CPQ displays assets from a single account related to the quote.

    It is recommended to keep the value as False. Set it to True only if there is a business requirement to fetch assets from multiple accounts.

    CodeLeave the field blank.
  4. Click Save.

To configure a custom callback class

  1. Configure a custom callback class to fetch assets from the list of accounts. The sample code below enables you to fetch assets from multiple accounts.

    /*
     * This class is used in Asset Line Item callback to show asset on Cart page.
     */
    global with sharing class CurrentUserFilter_AssetLineItemCallback implements Apttus_Config2.CustomClass.IAssetLineItemCallback4 
    	{
    
        private List<String> assetSearchScope = null;
        private String assetSearchFilter = null;
        private ID userId = null;
    
        /**
         * Callback at the beginning of the asset selection call.
         * Use the start method to initialize state
         * @param cart the cart object or null if there is no cart context
         * @param assetSearchFilter the preset static filter used in the asset search or null if there is no preset filter
         * @param assetSearchScope the list of asset fields to match the search text or empty to use the default list of fields
         */
        global void start(Apttus_Config2.ProductConfiguration cart, String assetSearchFilter, List<String> assetSearchScope) {
            this.userId = cart.getConfigSO().CreatedById;
        }
    
        /**
         * Callback to return part of SOQL filter clause
         * This filter is used in listing installed products
         * @param accountId is the context account id 
         * @return The query filter is like the following.
         *         Name LIKE 'A%' AND Quantity__c > 100
         *         Id IN ('000123', '000124') 
         */
        global String getQueryFilter(ID accountId) {
            // all Asset Lines created by the current user
            return 'CreatedById = \'' + userId + '\' AND CreatedDate > LAST_MONTH';
        }
        
        global Boolean validateAssetTermination(Set<ID> assetIds, Set<ID> accountIds, Date eDate) {
            return true;
        }
        
        global Date getAssetTerminationDate() {
            return Date.newInstance(2018,01,01);
        }
    
        /**
         * Callback to return the filter expression for the asset query where clause
         * This filter is used in listing installed products
         * @param params the parameters for the method
         * @return the filter expression or null to use the default filter.
         * e.g. Name LIKE 'A%' AND Quantity__c > 100
         *         Id IN ('000123', '000124') 
         */
        global String getFilterExpr(Apttus_Config2.CustomClass.ActionParams params) {
            return getQueryFilter(null);
        }
    
        /**
         * Gets the asset search scope
         * @return the asset search scope or null to use the default asset search scope
         */
        global List<String> getAssetSearchScope(){
            return this.assetSearchScope;
        }
    
        /**
         * Callback after the filter is used
         * Use the finish method to release state
         */
        global void finish() {
            
        }
    }
    CODE
  2. Copy the custom callback class in the Config Custom Classes under Asset Line Item Callback Class. For more information, see Asset Line Item Callback Class.


This table shows how CPQ behaves with different combinations of the admin setting and the custom callback class.

APTS_EnableInstallBaseFilteringAcrossAccountsCustom Callback ClassCPQ Behavior
TrueActiveCPQ displays assets from multiple accounts.
FalseActiveCPQ displays assets from the current account.
TrueInactiveCPQ displays assets from the current account.
FalseInactiveCPQ displays assets from the current account.