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.

Show Page Sections

Configure the Custom Cart Approvals Preview Page

Conga Approvals includes a built-in Preview and Submit page (Apttus_Approval__PreviewSubmitApprovals) that lets a submitter review approval steps and submit a request for any context object, including agreements, opportunities, quotes, and product configurations. This standard page works without additional development.

The Custom Cart Approvals Preview page is a purpose-built Visualforce page for the CPQ shopping cart approval workflow. Use this topic when you need to display additional cart-specific information alongside the standard approval steps. Examples include product pricing summaries, discount data, and custom business fields. Because the standard Apttus_Approval__PreviewSubmitApprovals page is part of the managed Conga package and cannot be edited, creating this custom page is the only way to add custom content to the cart approval preview.

Insert custom content sections above or below the standard approval preview area by adding Visualforce markup directly to the AptsCartApprovals.page file at the positions marked in the template comments.
Note: The Custom Cart Approvals Preview page does not replace the Conga approval engine. It is a custom entry point that passes the cart context to the same managed Apttus_Approval:SObjectApprovals2 component that the standard Conga page uses. All approval routing, step evaluation, and notifications continue to work as configured in your approval process.

Comparison with the Standard Preview and Submit Page

Both pages use the same Conga approval engine and display the same approval step information. The differences are in scope, entry point, customizability, and how the cart version is resolved.

AspectStandard Conga Preview and SubmitCustom Cart Approvals Preview Page
PageApttus_Approval__PreviewSubmitApprovals. This is a managed page, part of the Conga package, and cannot be edited.AptsCartApprovals. This is a custom Visualforce page that you own and can extend.
ControllerManaged controller inside the Conga Approvals package. The source is not accessible.AptsCartApprovalsController. This is a custom Apex class where you can add your own SOQL queries and data logic.
Works withAny object configured in Approvals Custom Config (agreements, opportunities, quotes, product configurations)Specifically Apttus_Config2__ProductConfiguration__c (the CPQ shopping cart)
Entry pointButton or formula field on any object, using a URL formula: /apex/Apttus_Approval__PreviewSubmitApprovals?id={!Object.Id}Approvals button on the Quote/Proposal page layout. Always previews the most recent Saved cart version from the Configurations related list.
Cart version awarenessThe page uses only the record ID passed in the URL and does not track cart version history.The controller automatically queries the most recent Saved ProductConfiguration version. It ignores older superseded versions.
Custom content sectionsNot supported. The managed page cannot be modified.Add custom Visualforce markup above or below the approval steps in the AptsCartApprovals.page file.
Button actionsPreview, Submit, RecallReturn, Submit, Submit with Attachments, Cancel Approvals
Dialog modeNot supported natively.Supports isDialog=true, which hides the cart header and Return button for clean rendering inside a modal or iframe.
When to useStandard approvals for agreements, opportunities, or any non-cart object where no custom content is needed.Cart approvals where the preview must show cart-specific data alongside the approval steps, or where a custom page layout is required for the cart workflow.

Required Files

The following four files are required. Do not modify the utility classes. You can customize the controller and page.
FilePurpose
AptsCPQApprovalsConstants.clsShared URL parameter and status string constants. The controller extends this class. Do not modify.
AptsCPQApprovalsUtil.clsNull and empty check helpers used by the controller. Do not modify.
AptsCartApprovalsController.clsCustom Apex controller. Resolves the cart version, builds the approval context, and handles all button actions. Extend this file with your own logic.
AptsCartApprovals.pageCustom Visualforce page. Renders the approval preview and buttons. Insert your custom content sections here.

Step 1: Create the Utility Classes

Complete the following prerequisites before you begin:

  • The Conga Approvals and CPQ packages are installed in your Salesforce org.
  • The standard Conga Approvals workflow is configured for the Apttus_Config2__ProductConfiguration__c object. This includes approval processes, approval steps, entry criteria, and status picklist values.
  • An Approvals Custom Config record exists for Apttus_Config2__ProductConfiguration__c in Setup > Develop > Custom Settings.
  • You have administrator access in Salesforce.
  • You are familiar with Salesforce Visualforce and Apex.
These classes provide the shared foundation for the controller. Create them first and do not modify their code.
  • AptsCPQApprovalsConstants: This class centralizes every URL parameter name and approval status string used across the controller. The controller extends this class, so all constants are available to it directly.
  • AptsCPQApprovalsUtil: This class provides null and empty check helpers that the controller uses to process URL parameters safely before acting on them.
  1. Go to Setup > Develop > Apex Classes.
  2. Click New.
  3. Create the AptsCPQApprovalsConstants class. Pass the following code, confirming that the class name is AptsCPQApprovalsConstants.
    /**
     * AptsCPQApprovalsConstants - shared constants. Do not modify.
     * @2013-2026 Apttus Inc. All rights reserved.
     */
    public virtual class AptsCPQApprovalsConstants {
        public static final String PARAM_RET_ID       = 'retId';
        public static final String PARAM_ACTION       = 'action';
        public static final String PARAM_RET_URL      = 'retURL';
        public static final String PARAM_QUOTE_ID     = 'quoteId';
        public static final String PARAM_IS_DIALOG    = 'isDialog';
        public static final String PARAM_CONFIG_ID    = 'Id';
        public static final String PARAM_SOBJECTID    = 'sObjectId';
        public static final String STATUS_SAVED       = 'Saved';
        public static final String STATUS_PENDING_APPROVAL = 'Pending Approval';
        public static final String STATUS_APPROVAL_REQUIRED = 'Approval Required';
        public static final String STATUS_NOT_SUBMITTED = 'Not Submitted';
        // ... additional constants omitted for brevity
    }
  4. Click Save. The system saves the class and returns to the Apex classes list.
  5. Create the AptsCPQApprovalsUtil class by clicking New and pasting the following code, confirming that the class name is AptsCPQApprovalsUtil.
    /**
     * AptsCPQApprovalsUtil - null/empty helpers. Do not modify.
     * @2013-2026 Apttus Inc. All rights reserved.
     */
    public with sharing class AptsCPQApprovalsUtil {
        public static Boolean nullOrEmpty(String strValue) {
            return (strValue == null || strValue.trim().length() == 0);
        }
        public static Boolean nullOrEmpty(List<Object> objList) {
            return (objList == null || objList.isEmpty());
        }
    }
    
  6. Click Save.
    Warning: Both utility classes must be saved and active before you proceed. The controller does not compile without them

Step 2: Create the AptsCartApprovalsController Class

This controller manages all page behavior. It determines whether the page opened from a quote or from the cart, queries the most recent product configuration version, and builds the approval context passed to the page component.

Before you customize the controller:

  • To show extra columns beyond the defaults (Sequence, Step Name, Assigned To), pass a field set name as the arFieldSetName URL parameter when configuring the Approvals button. The field set must exist on Apttus_Config2__ProductConfiguration__c.
  • When the page opens from a quote (quoteId is set in the URL), the controller sets fromQuote to true, hides the cart header, and applies the Return label to the Return button. When the page opens from the cart (configId is set), the cart header is visible and labeled Return to Cart.
  • Add custom SOQL queries or data transformations after the prepareContext() call in the constructor.
  1. Go to Setup > Develop > Apex Classes.
  2. Click New.
  3. Pass the following code. Confirm the class name is AptsCartApprovalsController.
    /**
     * AptsCartApprovalsController
     * Custom controller for the Cart Approvals Preview page.
     * @2013-2026 Apttus Inc. All rights reserved.
     */
    public with sharing class AptsCartApprovalsController
        extends AptsCPQApprovalsConstants {
    
        protected Boolean fromQuote        = false;
        protected ID quoteId               = null;
        protected String returnButtonLabel = null;
        private   ID configId              = null;
        protected Apttus_Approval.SObjectApprovalContextParam2 ctxParam2 = null;
        private   Apttus_Config2__ProductConfiguration__c configSO = null;
    
        public AptsCartApprovalsController() {
            // Read URL parameters and set context flags
            // ... (full constructor code as supplied)
            prepareContext();
            // Add custom data-loading logic below this line.
        }
    
        private void prepareContext() { /* ... */ }
        public Boolean getCanSubmit()  { /* ... */ }
        public Boolean getCanCancel()  { /* ... */ }
        // ... additional getters and action methods as supplied
    }
    
  4. Click Save.
    The system saves the class and returns to the Apex classes list.

Step 3: Create the AptsCartApprovals Visualforce Page

This page renders the approval preview. It uses the same managed Apttus_Approval:SObjectApprovals2 component as the standard Conga preview page and wraps it with the cart header, action buttons, and your custom content sections.
Note: To add custom content, insert your Visualforce markup at the comments marked <!-- === INSERT CUSTOM CONTENT ABOVE THE APPROVAL STEPS HERE === --> and <!-- === INSERT CUSTOM CONTENT BELOW THE APPROVAL STEPS HERE === --> in the page source.
  1. Go to Setup > Develop > Pages.
  2. Click New.
  3. Pass the following code. Confirm the page name is AptsCartApprovals.
    <!-- AptsCartApprovals | @2013-2026 Apttus Inc. All rights reserved. -->
    <apex:page controller="AptsCartApprovalsController"
               sidebar="{!showSidebar}" showHeader="{!showHeader}">
      <apex:form>
        <!-- === INSERT CUSTOM CONTENT ABOVE THE APPROVAL STEPS HERE === -->
        <apex:outputPanel id="idHeaderPanel">
          <Apttus_Config2:CartHeader id="idCartHeader" cartId="{!configId}"
              rendered="{!showCartHeader}" />
        </apex:outputPanel>
        <apex:pageMessages id="errorPage" />
        <apex:outputPanel id="idApprovalsPanel">
          <Apttus_Approval:SObjectApprovals2 id="idSObjectApprovals"
              contextInfoParam="{!contextInfo}" />
        </apex:outputPanel>
        <apex:pageBlock rendered="{!NOT(hideButtons)}">
          <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="{!$Label.Apttus_Approval__Return}"
                action="{!doReturn}" />
            <apex:commandButton value="{!$Label.Apttus_Approval__Submit}"
                action="{!doSubmit}" rendered="{!canSubmit}" />
            <apex:commandButton value="{!$Label.Apttus_Approval__CancelApprovals}"
                action="{!doCancel}" rendered="{!canCancel}" />
          </apex:pageBlockButtons>
        </apex:pageBlock>
        <!-- === INSERT CUSTOM CONTENT BELOW THE APPROVAL STEPS HERE === -->
        <apex:actionFunction name="returnToCaller"
            action="{!doReturnToCaller}" />
      </apex:form>
    </apex:page>
    
  4. Click Save.
    The system saves the page and returns to the Visualforce Pages list.
  5. Click Save.
    Note: If you change the page name, update the Cart Approval Preview Page field in Setup > Develop > Custom Settings > Approvals System Properties to match.

Step 4: Add the Approvals Button to the Quote/Proposal Page Layout

The Approvals button on the Quote/Proposal page launches the custom preview page. New installations add the button automatically. If you are upgrading, you must add it manually.

  1. Go to Setup > Object Manager > Quote/Proposal > Page Layouts.
  2. Click Edit for the relevant layout.
  3. Drag the Approvals button from the palette into the Custom Buttons section.
  4. Click Save.

Step 5: Register the Custom Page in Approvals System Properties

  1. Go to Setup > Develop > Custom Settings.
  2. Click Manage next to Approvals System Properties.
  3. Click Edit.
  4. Enter AptsCartApprovals in the Cart Approval Preview Page field.
  5. Click Save.

The custom Cart Approvals Preview page is active. When a user clicks Approvals on a quote or proposal record with a configured shopping cart, the custom page opens and displays the applicable approval steps alongside any custom content you added. Agreement, opportunity, and other object approvals continue to use the standard Conga Apttus_Approval__PreviewSubmitApprovals page without any change.