Right now, the Warehouse app lets users modify data as necessary, however they see fit. However, in many cases, business dictates that certain flows happen. One of the best examples of this is an approval process — when someone needs to approve a change to a record before the change is final.
In this tutorial, you learn how to implement a common approval process scenario in the Warehouse app. The approval process requires that, when a user changes the default Unit Price in a Line Item, the user submits the change for approval, after which a manager must approve or reject the change.
You must complete Quick Tutorial 1: Build a Cloud App in 5 Minutes before continuing with this tutorial.
To create an approval process, start in the familiar Setup area by clicking <your_name> | Setup | Create | Workflow & Approvals and choose Create New Approval Process. Then choose the Line Item object and then select Use Jump Start Wizard.
Configure the approval process basics as follows:
Approve Unit Price Change.
Before moving on, make sure your screen looks like the following:
Now you need to assign the approval to someone. For large companies where multiple people could have the ability to grant approval, you might assign this to a queue. In your org, there's only one user (yourself), so click the option for Automatically assign to approvers and choose yourself. Then select Approve or reject based on the FIRST response.
Save your work, click OK in the pop-up, and then click View Approval Process Detail Page.
The detail page of the approval process has a lot going on, and it's worth a minute to explore the following image:
On the detail page you can:
In addition, you can add new steps and actions (email alerts, field updates, and outbound messages) wherever you want.
In this step you modify the approval process so that if the price change is rejected, the price resets to the default merchandise price.
Merchandise__r.Price__cand then Save.
Before you can use the approval process, you need to activate it. This might seem like an unnecessary step until you think about situations where you might not want an approval process to run. For example, let's say you want to run a special promotion and decrease the price of a certain laptop in all open invoices. This would fire off the approval process for every open invoice, creating a bottleneck to getting orders out the door. In a case like this, you'd want to deactivate the approval process before running the batch update. When you're finished, you'd active the approval process again.
Now it's time to try out the new approval process and simulate the workflow as both the submitter and approver of a change.
Approval processes have built-in support for email, so approvers can approve or reject approvals directly from their email.
Too low, please adjust.
Congratulations. This is a fairly complex piece of app logic that you implemented without any code.