Make Declarative Changes in Your Scratch Org

In this exercise, you will…

  • Use Object Manager to open the “Travel Expense” custom object
  • Add a field named “Approved” to the “Travel Expense” custom object
  • Try to view the “Travel Expense” custom object (spoiler alert: you can’t)
  • Create a Custom Object Tab for “Travel Expense”
  • Create a “Travel Expenses” Lightning App

Use Object Manager to open the “Travel Expense” custom object

  1. In your scratch org, inside of Setup, click on the Object Manager tab.
  2. Search for “travel” in the Quick Find box, then click on the Travel Expense object link.

Add a custom field named “Approved” to the “Travel Expense” custom object

Step 1 of 5: Use the Object Manager to create a new field

  1. Make sure you’re in the Object Manager page for Travel Expense.
  2. Click on the Fields & Relationships menu item.
  3. Click on the New button.

Step 2 of 5: Choose the field type

  1. Select the Checkbox Data Type.
  2. Click Next to continue.

Step 3 of 5: Enter the details for this field

  1. Set the Field Label to Approved.
  2. Set the Default Value to Unchecked.
  3. Make sure the Full Name is set to Approved.
  4. Click Next to continue.

Step 4 of 5: Establish field level security

  1. Check, then un-check Visible to make sure that it’s left unchecked on all profiles.
  2. Check, then un-check Read-Only to make sure that it’s left unchecked on all profiles.
  3. Click the Next button to continue.

Step 5 of 5: Add to page layouts

  1. Make sure that this field is added to the Travel Expense Layout
  2. Click Save to finish creating this field.

After saving your custom field, your screen should look something like this:

  1. Note that the previous field and your new field both have a namespace prefix, even though you’re not developing in a packaging org. This is the power of Namespaced scratch orgs!

Try to view the “Travel Expense” custom object (spoiler alert: you can’t)

  1. Open the App Launcher.
  2. Search for an app item or object named Travel Expense
  3. You don’t see anything because there isn’t a custom tab for this object yet. We’ll fix that next.

Create a Custom Object Tab for “Travel Expense”

In order for users to interact with the Travel Expense object you’ll need to create an object tab for it.

Step 1 of 4: Create a new Custom Object Tab

  1. In Setup, click the Home tab.
  2. Type “tabs” into the Quick Find box.
  3. Click on the Tabs menu item.
  4. Click the New button in the Custom Object Tabs section.

Step 2 of 4: Define the details of your Custom Object Tab

  1. Select the Travel Expense custom object.
  2. Select the “Credit Card” tab style.
  3. Keep Splash Page Custom Link set to “None” and add a Description.
  4. Click Next to continue.

Step 3 of 4: Specifiy the app visibility for this tab (“Tab Hidden” for all)

  1. Make sure that tab visibility is set to “Tab Hidden” for all profiles.
  2. Click Next to continue.

Step 4 of 4: Add the tab to Custom Apps

  1. Uncheck all boxes here (you’ll be assigning the app via a permission set in an upcoming exercise)
  2. Click Save to finish creating the Custom Tab.

After saving your custom object tab, your screen should look something like this:

Create a “Travel Expenses” Lightning App

Step 1 of 6: Create a New Lightning App

  1. In Setup, click the Home tab.
  2. Type “app man” in the Quick Find box.
  3. Click on the “App Manager” menu item.
  4. Click the New Lightning App button.

Step 2 of 6: Specify App Details and Branding

  1. Set the App Name to Travel Expenses.
  2. Set the Developer Name to Travel_Expenses.
  3. Click the Next button.

Step 3 of 6: Set the Navigation and Personalization options

  1. Use the Standard Navigation setting.
  2. Use Setup (full set of Setup options).
  3. Click Next to continue.

Step 4 of 6: Specify options for Utility Items

  1. Don’t set anything here. Just click Next to continue.

Step 5 of 6: Specify the Navigation Items

  1. On the list of Available Items, enter “travel” in the search box.
  2. Highlight the Travel Expenses item and move it from left to right by clicking the right-facing arrow. It should END up in the position highlighed by the screen shot.
  3. Click the Next button to continue.

Step 6 of 6: Specify User Profiles that can access this app

  1. Make sure that no profiles are selected.
  2. Click Save & Finish to continue.

Updated: