Pre requisite:

Before you start configuring the new buttons on your context object, ensure that you have created a record with the API name of the context object in the Approvals Custom Config available at Setup > Develop > Custom Settings.

For example, if you want to configure Approvals on Agreement object and its Child objects, create a record for each of the objects in the Approvals Custom Config and perform the following steps. So, to configure Approvals for Agreement and Agreement Clause objects, create 2 records with the API names, Apttus__APTS_Agreement__c and Apttus__Agreement_Clause__c respectively. For more details, refer to Configuring Global Settings for Objects.


To enable Approvals for your context object, you must configure the following 2 buttons and place them on your object record’s page layout.

  • Preview & Submit Approval - For actions such as PreviewSubmitRecall for Submitter.
  • My Approvals - For actions such as ApproveRejectAdd Ad hoc ApproverReassign.

Configuring the My Approvals button

The My Approvals page is the page within Salesforce where you can act on the approval requests assigned to you.


The My Approvals page is primarily used by the requester for the following tasks.

  • View the list of items that need approval from the current logged in approver
  • To take ownership of the approval items that are assigned to queues or roles, if the current user is a member of the queue / role
  • To approve or reject one or more assigned approval items
  • To add ad hoc approver to the list of approvers

For configuring My Approvals button for your context object, follow any one of the following procedures:

  • Creating a custom button for your context object
  1. Go to Setup > Create > Objects and search for your object.
  2. In the Buttons, Links, and Actions section, click New Button or Link.
  3. In the Label field, enter My Approvals.
  4. In the Display Type, select Detail Page Button.
  5. In the Behavior drop-down list, select Display in existing window without sidebar or header.
  6. In the Content Source drop-down list, select URL.
  7. Enter the following formula in the Advanced Formula section,
    /apex/Apttus_Approval__MyApprovals?id={!context-object-api-name.Id}

    Ensure that in the context-object-api-name, you enter the API name of your context object.
    In our example for Agreement object, enter Apttus__APTS_Agreement__c as context-object-api-name.
  8. Click Save.
  9. Go to a record of your object, click the Edit Layout link.
  10. From the Buttons list, drag and drop the newly created button on your page layout and click Save.
  • Creating a custom formula field for your context object
  1. Go to Setup > Create > Objects and search for your object. In our example, select Agreement object of Contract Management package.
  2. In the Custom Fields & Relationships section, click New.
  3. Select Formula as the field type and click Next.
  4. In the Field Label, enter My Approvals, select Text as Formula Return Type and click Next.
  5. In the Advanced Formula text box, enter the following formula:
    IF(OR((ISPICKVAL(Approval_Status__c,"Pending Approval")), (ISPICKVAL(Approval_Status__c,"Approved"))), HYPERLINK("/apex/Apttus_Approval__MyApprovals?Id="&Id, IMAGE("/resource/[button-image]", "My Approvals"),"_self"),NULL)

    Ensure that you enter the API name of the field you use for Approval Status of your context   object, which you defined before configuring this button.
  6. After checking the syntax of your formula field, click Next.
  7. Select visibility for your required profiles and click Next.
  8. Select appropriate page layouts on which you want to display the new field and click Save.


Configuring the Preview & Submit Approvals button

The Approvals page enables you to preview the approval requests assigned to you. The sample files provide the base for customizing the information to display on the page. However, you must ensure you keep the Approval Action code on the page so that users can approve or reject requests assigned to them. The Approvals page is primarily used by the requester for the following tasks.

  • Preview a list of all approvals that will be required before they are submitted for approval. You can preview and submit approvals for complex processes.

  • View a list of all approvals including those that have already been submitted and approved or rejected, or are in another status such as Assigned, On Hold, or Not Submitted. You can also view a large number of requests in the my approvals page without view state errors.

  • Allow the submitter to recall all approvals for the current context object.

You can follow any one of the following procedures to configure Preview & Submit Approvals button for your context object:

  • Creating a custom button for your context object:
  1. Go to Setup > Create > Objects and search for your object.
  2. In the Buttons, Links, and Actions section, click New Button or Link.
  3. In the Label field, enter Preview & Submit Approvals.
  4. In the Display Type, select Detail Page Button.
  5. In the Behavior drop-down list, select Display in existing window without sidebar or header.
  6. In the Content Source drop-down list, select URL.
  7. Enter the following formula in the Advanced Formula section,
    /apex/Apttus_Approval__PreviewSubmitApprovals?id={!context-object-api-name.Id}

    Ensure that in the context-object-api-name, you enter the API name of your context object.

    In our example for Agreement object, enter Apttus__APTS_Agreement__c as context-object-api-name.

  8. Click Save.
  9. Go to a record of your object, click the Edit Layout link.
  10. From the Buttons list, drag and drop the newly created button on your page layout and click Save.


  • Creating a custom formula field for your context object:
  1. Go to Setup > Create > Objects and search for your object. In our example, select Agreement object of Contract Management package.
  2. In the Custom Fields & Relationships section, click New.
  3. Select Formula as the field type and click Next.
  4. In the Field Label, enter Preview & Submit Approvals, select Text as Formula Return Type and click Next.
  5. In the Advanced Formula text box, enter the following formula:
    IF(AND(NOT(ISPICKVAL(Approval_Status__c,"Pending Approval")), NOT(ISPICKVAL(Approval_Status__c,"Approved"))), HYPERLINK("/apex/Apttus_Approval__PreviewSubmitApprovals?Id="&Id, IMAGE("/resource/[button-image]", "Preview & Submit Approvals"),"_self"),NULL)

    Ensure that you enter the API name of the field you use for Approval Status of your context object, which you defined before configuring the My Approvals, Preview, and Submit button.
    Along with ID as a mandatory parameter, you can also append the following optional parameters to capture more details by a button click.

    These parameters are applicable only for CPQ.

    Parameter nameDatatypeUse of the parameter
    ctxChildSObjectIdID of the child context object

    To view subset of approvals required for the specified child context object.

    returnIdID of the object

    To return to detail view of the object referred to by this identifier.

    returnPagestring

    To return to the specified page.

    returnButtonLabelstring

    To use the specified label for the return button. This is useful when this page is invoked from multiple locations or pages.

    autoPreviewIndicatorboolean

    To force the system to perform Preview before displaying approval requests.

    hideSubmitWithAttachmentsbooleanIndicator to instruct the system to hide Submit with Attachments button.
    headerSObjectIdId of the standard object

    The ID to be rendered as a link in the header of the page, if different from the context object. This is used to display the Quote link instead of Cart or Product Configuration link. 

    headerSObjectTitlestring

    The title or label to display as a link in the header next to the ID, if one wants to display a value other than the Name field value of the context object.

    CancelPendingProcess
    (deprecated from 7.2.370 onwards use Enable Resubmit instead)
     boolean 
    • true:Cancel the previous approval requests on the object record and submit a new approval request for the object every time you click Submit. To configure this behavior, in the My Approvals Formula button for your context object set the CancelPendingProcess parameter to true. For example,/apex/ ApprovalContextPreview?sObjectType=Apttus__APTS_Agreement__c&sObjectId={!Apttus__APTS_Agreement__c.Id}&CancelPendingProcess=true.
    • false:The existing Approval Process will not be cancelled. To configure this behavior, in the My Approvals Formula button for your context object set the CancelPendingProcess parameter to false. For example, /apex/ ApprovalContextPreview?sObjectType=Apttus__APTS_Agreement__c&sObjectId={!Apttus__APTS_Agreement__c.Id}&CancelPendingProcess=false.
    • If you do not pass any parameter in the formula field, the approval requests on the context object are cancelled and a new approval request is submitted.
  6. After checking the syntax of your formula field, click Next.
  7. Select visibility for your required profiles and click Next.
  8. Select appropriate page layouts on which you want to display the new field and click Save.