Set Up the BOTanicals App
Learning Objectives
In this project, you'll:
- Install a package in your Trailhead Playground.
- Create an Apex class and method.
- Create a trigger.
- Automate the process of creating a new sObject.
Introduction to BOTanicals
BOTanicals is a company that makes robotic flowers, the environmental and hypoallergenic alternative to traditional flowers. These flowers change color to suit your mood, glow in the dark, and never die. They're controlled by a state-of-the-art Salesforce org that's connected to the Internet of Things. You're just in time for the BOTanical Bonus Bouquet promotion. In this project, we automate a business process to support the promotion. Specifically, we code our app to add a bonus bouquet every time an order is activated.
The BOTanical Object Model
First things first, let's look at our object model.
ID |
Account Name (ID) |
Order (ID) |
Order Product Number (ID) |
Product (ID) |
Fields |
Account Name |
Order Product numberOfFlowers__c percentOfOpening__c fragrance__c grow__c colorTheme__c |
numberOfFlowers__c percentOfOpening__c |
|
Object Relationships |
Account Name (ID) maps to the Account Name field on the Order object |
Order (ID) maps to the Order field on the OrderItem object |
Product (ID) maps to the Product field on the OrderItem object |
You probably notice a few familiar standard objects: Account, Order, OrderItem, and Product. There are also some custom fields in the OrderItem and Product objects. Each Order belongs to a single Account. Each OrderItem belongs to a single Order and a single Product.
Most of our coding revolves around the Order and OrderItem standard objects.
Create a New Trailhead Playground
For this project, you need to create a new Trailhead Playground. Scroll to the bottom of this page, click the down arrow next to Launch, and select Create a Trailhead Playground. It typically takes 3–4 minutes to create a new Trailhead Playground.
Launch Your Trailhead Playground and Install a Package
Let's get started by opening your Trailhead Playground and installing a package. First, scroll to the bottom of this page and click Launch If you see a tab in your org labeled Install a Package, great! Follow the steps below.
If not, from the App Launcher (), find and open Playground Starter and follow the steps.
- Click the Install a Package tab.
- Paste
04t8b000001RwQK
into the field.
- Click Install.
- Select Install for Admins Only, then click Install.
When the package is finished installing, you see a confirmation page and get an email to the address associated with your playground.
Update the Default Order Page Layout
- Click and select Setup.
- Click Object Manager.
- Click Order.
- Click Page Layouts.
- Click Page Layout Assignment.
- Click Edit Assignment.
- Click the Page Layout column header to select all the profiles.
- For Page Layout to Use, select Order Layout (BOTanicals).
- Verify the Page Layout column now lists Order Layout(BOTanicals) for every profile.
- Click Save.
Pin Three List Views in the BOTanicals App
- From the App Launcher (), find and open BOTanicals. The list views on the BOTanicals home page will be empty. Don't worry, we add some data soon.
- Click All Accounts (BOTanicals).
- Click to pin the list view on this page.
- Click Home.
- Pin the All Orders (BOTanicals) list view and the All Products (BOTanicals) list view.
Load Sample Data
- Click and select Setup.
- In the Quick Find box, enter
Flows
.
- Under Process Automation, select Flows.
- Click Load Sample Data.
- Click Run.
- When you see YOUR FLOW FINISHED, close the Load Sample window.
- Close the Flow Builder window.
- From the App Launcher (), find and open BOTanicals.
Your home page should now have entries in the Accounts, Orders, and Products sections. The BOTanicals app is ready to go.