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

Bouquet of colorful flowers with the BOTanicals logo.

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. 

Order form labeled Active = +1 Bonus Bouquet.



In this project, we work with business processes that you could easily automate using point-and-click admin tools. As you work through the steps, think about the connection between what is happening in the code and how you would do the same tasks in the Salesforce UI.

The BOTanical Object Model

First things first, let’s look at our object model.  Object Model listed from left to right Account (Account Name [ID]), Order (Order[ID], Account Name), Order Item (Order Product Name [ID], Order, Product, numberOfFlowers__c, percentOfOpening__c, fragrance__c, glow__c, colorTheme__c), Product (Product[ID], numberOfFlowers__c, percentOfOpening__c)

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. 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. 



Yes, we really mean a brand-new Trailhead playground! If you use an existing org or playground, you can run into problems completing the challenges.

Launch Your Trailhead Playground and Install a Package

Let's get started by installing an unmanaged package into your Trailhead Playground.

  1. Scroll down to the bottom of the page and click Launch to open your Trailhead Playground.

Then get your username and password.

  1. Click Setupand select Setup.
  2. Enter Users in the Quick Find box, then select Users.
  3. Check the box next to your name. Make note of your username.
  4. Click Reset Password(s) and then OK. This step sends an email to the address associated with your username. If you don’t see the email, check your spam folder.
  5. Click the link in the email.
  6. Enter a new password and confirm it.
  7. Click Change Password.

Next, install the package.

  1. Open an incognito browser window in Chrome.
  2. In the incognito window, paste this link into the address bar to install the unmanaged package.
  3. On the Salesforce login screen, enter the username and password for your Trailhead Playground, then click Log In.
  4. Select Install for All Users, then click Install.

If you’re having trouble finding your username and resetting your password, see this article. If you have trouble installing the package, see the Install Apps and Packages in Your Trailhead Playground unit of the Trailhead Playground Management module.

Update the Default Order Page Layout

  1. Click Setup and select Setup.
  2. Click Object Manager.
  3. Click Order.
  4. Click Page Layouts.
  5. Click Page Layout Assignment.
  6. Click Edit Assignment.
  7. Click the Page Layout column header to select all the profiles.
  8. For Page Layout to Use, select Order Layout (BOTanicals).
  9. Verify the Page Layout column now lists Order Layout(BOTanicals) for every profile. Page Layout Assignments for each profile listing the Order Layout (BOTanicals) option.
  10. Click Save.

Pin Three List Views in the BOTanicals App

  1. Click App Launcherand select the BOTanicals app. The list views on the BOTanicals home page will be empty. Don’t worry, we add some data soon.
  2. Click All Accounts (BOTanicals).
  3. Click Pin this list view to pin the list view on this page.
  4. Click Home.
  5. Pin the All Orders (BOTanicals) list view and the All Products (BOTanicals) list view.

Load Sample Data

  1. Click Setupand select Setup.
  2. In the Quick Find box, enter Flows.
  3. Under Process Automation, select Flows.
  4. Click Load Sample Data.
  5. Click Run.
  6. When you see YOUR FLOW FINISHED, close the Load Sample window.
  7. Close the Flow Builder window.
  8. Click App Launcherand select BOTanicals.

Your home page should now have entries in the Accounts, Orders, and Products sections. The BOTanicals app is ready to go.