Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

Create an Approval Process

Introduction

Salesforce includes built-in approval process capabilities. An approval process is an automated process your agency can use to approve records in Salesforce. An approval process specifies the criteria a record must meet before it can be submitted for approval, the steps necessary for a record to be approved, and who must approve it at each step. A step can apply to all records included in the process or just records that have certain attributes. An approval process also specifies the actions to take when a record is approved, rejected, recalled, or first submitted for approval.

Create the Approval Process

In this section, you create an approval process that all travel approvals must follow. We keep it simple and use the following logic.

  • All travel approvals are sent to the employee’s direct manager for approval.
  • If the trip is out of state, the approval is also sent to a travel coordinator for approval. If not out of state, this step is skipped.

Let’s get started.

  1. Click Setup and select Setup.
  2. Select Process Automation | Approval Processes (or use the Quick Find and search for Approval Processes).
    Process Automation menu with Approval Processes selected
  3. In the Manage Approval Processes For list, select Travel Approval.
  4. Click Create New Approval Process and select Use Jump Start Wizard.
    Approval Process with Use Jump Start Wizard selected
  5. Enter the following parameters.
    • Name: Travel Approval Request
    • Unique Name: Travel_Approval_Request (This automatically gets sent when you tab out of the Name field)
    • Approval Assignment Email Template: Leave blank
    • Add the Submit for Approval button and Approval History related list to all Travel Approval page layouts: Leave this selected/checked
    • Use Approver Field of Travel Approval Owner: Leave unselected/unchecked
    • Use this approval process if the following: criteria are met
    • Field: Travel Approval: Total Expenses
    • Operator: greater than
    • Value: 0
    • Select Approver: Select Automatically assign an approver using a standard or custom hierarchy field and select Manager from the dropdown list
  6. Click Save.
  7. Click View Approval Process Detail Page.

Notice in the Approval Steps section that it already created a rule to route all approvals to a user’s manager.

Create an Approval Step for Out-of-State Travel

Now, let’s create another approval step to send out-of-state travel to a travel coordinator.

  1. Click New Approval Step.
  2. Enter the following details.
    • Name: Travel Coordinator Approval
    • Unique Name: Travel_Coordinator_Approval (This automatically gets set when you tab out of the Name field)
    • Step Number: 2
  3. Click Next.
  4. Ensure Enter this step if the following is selected and the criteria are met option is selected.
  5. Enter the following formula criteria
    • Field: Travel Approval: Out-of-State
    • Operator: equals
    • Value: True
  6. Click Next.
  7. Select the Automatically assign to the approver(s) option.
  8. Select User from the dropdown and select your name as the travel coordinator.
    NOTE: In the real world, a user would not be selected as an approver of their own request. Salesforce demo orgs are limited to two Salesforce users. For this project, just use your user account for the travel coordinator.
  9. Click Save.
  10. Select No, I’ll do this later. Take me to the approval process detail page to review what I’ve created and then click Go!

Add Logic

Next, add logic to set the status of the approval request based on if it was Approved or Rejected. We do this by creating a Final Approval action and a Final Rejection action. Let’s start by creating an action if the request was approved by all approvers. 

  1. Click Add New in the Final Approval Actions area of the approval process form.
  2. Select Field Update from the dropdown list.
    Final Approval Actions with Field Update selected
  3. Enter the following values.
    • Name: Set Status to Approved
    • Unique Name: Set_Status_to_Approved (This automatically gets sent when you tab out of the Name field)
    • Field to Update: Status
    • Re-evaluate Workflow Rules after Field Change: Leave unchecked
    • Picklist Options: Select A specific value and select Approved from the dropdown list
  4. Click Save.

Next, let’s set the status value to Rejected if any approver rejects the travel approval request. 

  1. Click Add New in the Final Rejection Actions area of the approval process form.
  2. Select Field Update from the dropdown list.
    Final Rejection Actions with Field Update selected
  3. Enter the following values.
    • Name: Set Status to Rejected
    • Unique Name: Set_Status_to_Rejected (This automatically gets sent when you tab out of the Name field)
    • Field to Update: Status
    • Re-evaluate Workflow Rules after Field Change: Leave unchecked
    • Picklist Options: Select A specific value and select Rejected from the dropdown list
  4. Click Save.
  5. Click Activate.
  6. Select OK in the popup window to confirm activation. Your approval process should now have the Active flag checked.
      Travel Approval Request on Approval Processes page.

Next, you enable email approval responses.

Enable the Email Approval Response

Along with being able to approve or reject travel approvals directly inside Salesforce, it’s possible to let users approve via email. When an employee submits their travel approval request, an email is sent to the next approver in the approval process to notify them of the request. That email includes a URL link to the travel approval record so that the approver can access the details easily. It is also possible to allow the approver to just respond to the email with text like APPROVE, YES, REJECT, NO, and so on. Let’s see how you do it.

  1. Click Setup and select Setup.
  2. From setup, enter Process Automation Settings in the Quick Find box and select it.
    Home page with Process Automation Settings selected
  3. Click the Process Automation Settings link.
  4. Make sure Enable Email Approval Response is selected.
    Process Automation Settings page
  5. Set the Default Workflow User to your name.
  6. Click Save.

Great job! Now let's test it out to make sure everything is working correctly. 

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback