Download PDF
Download page Action Params Callback Class.
Action Params Callback Class
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.
Method | Signature | Description |
---|---|---|
createActionParams | Apttus_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:
|
The following table lists the response parameters of the Apttus_Config2.CustomClass.IActionParamsCallback.
Response Parameters:Apttus_Config2.CustomClass.ActionParams | ||
---|---|---|
Name | Type | Description |
AccountId | Id | The ID of the Account. |
AccountIds | Set<Id> | The set of Account ID you want to use to filter the result. CPQ ignores the AccountId field if this field is used. |
ActionName | String | The name of the action. |
ActivateOrder | Boolean | Indicates whether to activate the order or not. |
ApprovalCtxType | String | The Context Type of Approval. |
ApprovalMode | String | The Mode of Approval |
ApprovalReason | String | The reason of Approval. |
ApprovalType | String | The type of Approval. |
AssetLineItems | List<Apttus_Config2__AssetLineItem__c> | The list of asset line items |
BundleId | Id | The IDs of the bundle product. |
CartIds | List<IDs> | The list of cart IDs. |
CartSyncMode | Apttus_Config2.CustomClass.SyncMode | The Sync Mode of the cart. For example, enum SyncMode {SYNC, FINALIZE}. |
ConfigurationId | Id | The ID of the configuration in the proposal. |
CurrentState | String | The current state |
CustomParams | Map<String, String> | The custom parameter that you have defined. |
FinalizeClass | String | The callback class that is executed when you finalize the cart. |
Flow | String | The flow used in the configuration |
IsAngular | Boolean | Indicates whether the user interface is Angular. |
IsDraft | Boolean | Indicated whether the proposal is in draft stage. |
LaunchState | String | The launch state. |
LineItemIds | Set<Id> | The set of line item IDs. |
LineNumber | Decimal | The line number of the products. |
LocationIds | Set<Id> | The set of location IDs. |
Method | String | The method of configuration. |
Mode | String | The mode of the configuration. |
OrderLineItems | List<Apttus_Config2__OrderLineItem__c> | The list of order line items. |
OriginalOrderSO | Apttus_Config2__Order__c | The Original Order SObject |
OutputFormat | String | The output format of the generated document. You can use the following values:
|
ProductIDs | List<IDs> | The list of product IDs. |
ProtectionLevel | String | The protection level for the parameters you created. |
RequestId | Id | The request ID of the configuration. |
ReturnId | Id | The record ID of the business object. |
ReturnPage | String | The return page of the business object. |
SessionId | String | The ID of the session. |
SessionUrl | String | The URL of the session. |
TemplateName | String | The 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;
}
}