Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Action Invoker Callback Class

Action Invoker Callback provides you a mechanism to implement custom navigation for custom actions. You can define logic for a custom page to redirect the Sales rep to.

When you click a configured custom action, the system automatically invokes the registered Action Invoker Callback class. The method receives the current cart and action context, and the returned PageReference determines the navigation. If the method returns null, no navigation occurs.

To use the Action Invoker Callback:

  • Create a custom Apex class that implements the Apttus_Config2.CustomClass.IActionInvokerCallback interface.

  • Register the custom Apex class in Config Custom Classes under Action Invoker Callback Class.

  • Configure the required custom action in Display Action Settings.

The system invokes the callback automatically when the custom action is clicked. You do not call the method explicitly.

The following methods are available in the Apttus_Config2.CustomClass.IActionInvokerCallback interface.

Method

Signature

Description

invokeAction

System.PageReference invokeAction(Apttus_Config2.ProductConfiguration, Apttus_Config2.CustomClass.ActionParams)

Use this method to implement custom navigation logic when the users click a custom action.

  • The cart parameter provides access to the current ProductConfiguration and related line items.

  • The params parameter contains contextual information about the action. The system populates this object at runtime.

You must return a valid PageReference to redirect the user. If you return null, the system does not perform navigation.

Access Cart Information

Use the cart object to access configuration and line item data.

Example:
cart.getConfigSO();     // Returns ProductConfiguration__c record
cart.getLineItems();    // Returns related LineItem__c records

Using Action Parameters

The system automatically populates the ActionParams object. Do not instantiate or populate it manually.

Commonly used fields include:

  • ActionName — Name of the clicked custom action

  • ConfigurationId — Current configuration Id

  • AccountId — Related Account Id

  • LineItemIds — Selected line item Ids

  • ReturnId — Parent object Id (Opportunity, Quote, and so on)

  • CustomParams — Custom key-value parameters defined in the action configuration

Use these fields to implement conditional navigation logic.

Example

The following sample code shows a basic structure of a custom callback class that implements the IActionInvokerCallback interface. Add your custom logic and return the required PageReference.

global with sharing class DefaultActionInvokerCallback implements Apttus_Config2.CustomClass.IActionInvokerCallback {   
   /**
    * Callback to invoke the custom action
    * @param cart the cart object
    * @param params the parameters for the action
    * @return the result page reference or null if there is no page
    */
   	 global ApexPages.PageReference invokeAction(ProductConfiguration cart, Apttus_Config2.CustomClass.ActionParams params) {
        	// do nothing
      		return null;     
    	}                  
}