Action Params Callback provides you a mechanism to create action parameters for a cart object. You can use the action parameters created using the callback in the following actions in CPQ:

  • Submitting the cart for approval
  • Generating document
  • Analyzing the deal
  • Retrieving Advanced Approval URL for selected line item

To use the Action Params Callback you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IActionParamsCallback interface and register the custom apex class with Action Params Callback Class. You must write your custom logic in the custom apex class.

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

MethodSignatureDescription
createActionParamsApttus_Config2.CustomClass.ActionParams createActionParams(Apttus_Config2.ProductConfiguration)You can use this method to create action parameters for the cart object. This method is invoked when you:
  • Submit the cart for approval
  • Retrieve Advanced Approval URL for selected line item
  • Perform the analyze deal action
  • Perform the generate doc action

The following table lists the response parameters of the Apttus_Config2.CustomClass.IActionParamsCallback.

Response Parameters:Apttus_Config2.CustomClass.ActionParams 
NameTypeDescription
AccountIdIdThe ID of the Account.
AccountIdsSet<Id>The set of Account ID you want to use to filter the result. CPQ ignores the AccountId field if this field is used.
ActionNameStringThe name of the action.
ActivateOrderBooleanIndicates whether to activate the order or not.
ApprovalCtxTypeStringThe Context Type of Approval.
ApprovalModeStringThe Mode of Approval
ApprovalReasonStringThe reason of Approval.
ApprovalTypeStringThe type of Approval.
AssetLineItemsList<Apttus_Config2__AssetLineItem__c>The list of asset line items
BundleIdIdThe IDs of the bundle product.
CartIdsList<IDs>The list of cart IDs.
CartSyncModeApttus_Config2.CustomClass.SyncModeThe Sync Mode of the cart. For example, enum SyncMode {SYNC, FINALIZE}.
ConfigurationIdIdThe ID of the configuration in the proposal.
CurrentStateStringThe current state
CustomParamsMap<String, String>The custom parameter that you have defined.
FinalizeClassStringThe callback class that is executed when you finalize the cart.
FlowStringThe flow used in the configuration
IsAngularBooleanIndicates whether the user interface is Angular.
IsDraftBooleanIndicated whether the proposal is in draft stage.
LaunchStateStringThe launch state.
LineItemIdsSet<Id>The set of line item IDs.
LineNumberDecimalThe line number of the products.
LocationIdsSet<Id>The set of location IDs.
MethodStringThe method of configuration.
ModeStringThe mode of the configuration.
OrderLineItemsList<Apttus_Config2__OrderLineItem__c>The list of order line items.
OriginalOrderSOApttus_Config2__Order__cThe Original Order SObject
OutputFormatString

The output format of the generated document. You can use the following values:

  • PDF
  • DOC
  • RTF
ProductIDsList<IDs>The list of product IDs.
ProtectionLevelString

The protection level for the parameters you created.

RequestIdIdThe request ID of the configuration.
ReturnIdIdThe record ID of the business object.
ReturnPageStringThe return page of the business object.
SessionIdStringThe ID of the session.
SessionUrlStringThe URL of the session.
TemplateNameStringThe name of the template in the proposal.

Example

The following sample code enables you to create parameters.

global with sharing class DefaultActionParamsCallback implements Apttus_Config2.CustomClass.IActionParamsCallback 
{
	/**
	 * Callback to create action parameters for the given cart object
	 * @param cart the cart object
	 * @return the action parameters object
	 */
    global Apttus_Config2.CustomClass.ActionParams createActionParams(Apttus_Config2.ProductConfiguration cart) 
	{
    	
    	// create a test configuration request
		Apttus_Config2.TempObject__c requestSO = new ConfigRequestTest().createTempObject('Quote');
		
    	// action parameters
		Apttus_Config2.CustomClass.ActionParams params = new Apttus_Config2.CustomClass.ActionParams();
		
		params.ActionName = 'CustomAction';
		params.ApprovalType = Apttus_Config2.CustomClass.APPROVALTYPE_STANDARD;
		params.ApprovalCtxType = Apttus_Config2.CustomClass.APPROVALCTX_HEADER;
		params.ApprovalMode = Apttus_Config2.CustomClass.APPROVALMODE_PREVIEW;
		params.ApprovalReason = 'Request for Approval';
		params.RequestId = requestSO.Id;
		params.Method = null;
		params.Mode = null;
		params.Flow = 'Default';
		params.LineNumber = 1;
		params.TemplateName = 'Test Template';
		params.ProtectionLevel = 'Read only';
		params.OutputFormat = 'PDF';
		params.IsDraft = true;
		params.SessionId = UserInfo.getSessionId();
		params.SessionUrl = 'https://login.salesforce.com'; // Use https://test.salesforce.com for sandbox.
		params.ReturnId = '01tA0000001qEcJ'; // The id of the bussiness object record 
		params.ReturnPage = 'MyCustomPage';
		params.CustomParams.put('CartId', cart.getId());
		
		return params;
		
    }															   
}
CODE