Configuring My Approvals and Approvals Pages
Prerequisite
- You have created a record with the API name of the context object in the Approvals Custom Config available at Configuring Global Settings for Objects. . For example, to configure Approvals on an agreement object and its child objects, create a record for each object in the Approvals Custom Config and perform the following steps. To configure Approvals for Agreement and Agreement Clause objects, create two records with the API names Apttus__APTS_Agreement__c and Apttus__Agreement_Clause__c. For more details, see
- You have enabled Approvals for your context object by configuring the following buttons and placing them on your object record’s page layout:
- Preview & Submit Approval: For actions such as Preview, Submit, and Recall for Submitter.
- My Approvals: For actions such as Approve, Reject, Add Ad Hoc Approver, and Reassign.
Configuring the My Approvals Button
The My Approvals page is the Salesforce page where you can act on approval requests assigned to you.
- Viewing the list of items needing the current logged in approver's approval.
- Taking ownership of the approval items assigned to queues or roles, if the current user is a member of the queue or role.
- Approving or rejecting one or more assigned approval items.
- Adding an ad hoc approver to the list of approvers.
To configure the My Approvals button for your context object, follow any of the following procedures:
- Create a custom button for your context object.
- Go to and search for your object.
- In the Buttons, Links, and Actions section, click New Button or Link.
- In the Label field, enter My Approvals.
- In the Display Type, select Detail Page Button.
- In the Behavior drop-down list, select Display in existing window without sidebar or header.
- In the Content Source drop-down list, select URL.
- Enter the following formula in the Advanced Formula section:/apex/Apttus_Approval__MyApprovals?id={!context-object-api-name.Id} Enter your context object's API name in context-object-api-name.In the agreement object example , enter Apttus__APTS_Agreement__c as the context-object-api-name.
- Click Save.
- Go to a record of your object, click the Edit Layout link.
- From the Buttons list, drag and drop the newly created button onto your page layout and click Save.
- Create a custom formula field for your context object.
Configuring the Preview & Submit Approvals Button
- 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:
- Go to and search for your object.
- In the Buttons, Links, and Actions section, click New Button or Link.
- Enter Preview & Submit Approvals in the Label field.
- In Display Type, select Detail Page Button.
- Select Display in existing window without sidebar or header from the Behavior drop-down.
- Select URL from the Content Source drop-down.
- Enter the following formula in the Advanced Formula section:
/apex/Apttus_Approval__PreviewSubmitApprovals?id={!context-object-api-name.Id}
Enter the API name of your context object in context-object-api-name.
In our example for Agreement object, enter
Apttus__APTS_Agreement__c
for context-object-api-name. - Click Save.
- Go to a record of your object and click the Edit Layout link.
- From the Buttons list, drag and drop the newly created button onto your page layout and click Save.
- Creating a custom formula field for your context object:
- Go to and search for your object. In our example, select the Contract Management package's agreement object.
- In the Custom Fields & Relationships section, click New.
- Select Formula as the field type and click Next.
- In the Field Label, enter Preview & Submit Approvals, select Text as Formula Return Type, and click Next.
Parameter name
Datatype
Use of the parameter
ctxChildSObjectId
ID of the child context object
To view subset of approvals required for the specified child context object.
returnId
ID of the object
To return to detail view of the object referred to by this identifier.
returnPage
string
To return to the specified page.
returnButtonLabel
string
To use the specified label for the return button. This is useful when this page is invoked from multiple locations or pages.
autoPreviewIndicator
Boolean
To force the system to perform Preview before displaying approval requests.
hideSubmitWithAttachments
Boolean
Indicator to instruct the system to hide Submit with Attachments button.
headerSObjectId
ID 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.
headerSObjectTitle
string
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, set the CancelPendingProcess parameter to true in your context object's My Approvals Formula button. 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 canceled. 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 canceled and a new approval request is submitted.
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)
Enter the API name of the field you use for your context object's approval status, which you defined before configuring the My Approvals, Preview, and Submit button.Along with the required ID parameter, you can also append the following optional parameters to capture more details by a button-click.These parameters are applicable only for CPQ.
- 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, set the CancelPendingProcess parameter to true in your context object's My Approvals Formula button. For example,
- After checking your formula field's syntax, click Next.
- Select visibility for your required profiles and click Next.
- Select the page layouts on which you will display the new field and click Save.