Download page Configuring the Cart Approvals Page and Apex Class.
Configuring the Cart Approvals Page and Apex Class
Go to Setup > Develop > Apex Classes and clickNew.
Copy and paste the code below and ensure the name of the new class is CartViewController.
/**
* Apttus CPQ Approval
* CartViewController
*
* @2012-2013 Apttus Inc. All rights reserved.
*/
public with sharing class CartViewController {
// context id
private ID contextId = null;
// approval type
private String approvalType = null;
/**
* Class Constructor
* @param stdController the standard controller
*/
public CartViewController(ApexPages.StandardController stdController) {
// get context id
contextId = stdController.getId();
// get default approval context type
//approvalType = SystemUtil.getDefaultApprovalCtxType();
approvalType = 'cart';
}
/**
* Gets context object Id
*/
public ID getCtxObjectId() {
return contextId;
}
/**
* Gets cart approval context type
*/
public String getCtxApprovalType() {
return approvalType;
}
}
CODE
Save the class and then go to Pages and click New.
Copy and paste the following code into the Visualforce Markup window
Scroll to Page Layouts and click Edit for the page layout you want to add Cart Approvals to.
From the Visualforce Pages window, drag and drop CartView onto the page.
Display the VisualForce Page Properties for CartView and select Show scrollbars.
Save the changes to the page.
The CartView page acts like a related list for displaying the Cart Approvals, so the next time you go to a Quote/Proposal record that has been submitted for approval from the Cart, the approval steps and associated approvers will be displayed.
You must finish configuring the other objects before the feature will work as expected.