Try It Out: Create a Compact Layout

If you don’t create custom compact layouts for an object, all of the object’s record highlight fields, preview cards, and action-related feed items are driven by a read-only, predefined system default compact layout that contains a predefined set of fields. After you create one or more custom compact layouts, you can set one as the primary compact layout for the object. The primary compact layout is then used as the default for that object.

We’ll create a custom compact layout, and then set it as the primary compact layout for the Merchandise object. Our new compact layout is used to render important merchandise record fields first in Salesforce1 for the Acme Wireless mobile technicians.

Before we can see compact layouts in action, though, we need a Merchandise record in our organization. Let’s quickly create one.
  1. From the Force.com app menu, select Warehouse.
  2. Click the Merchandise tab.
  3. Click New.
  4. For Merchandise Name, enter iPhone 4.
  5. For Price, enter 299.
  6. For Quantity, enter 1.
  7. Click the Warehouse lookup, then select Oaklandia.
  8. Set the Condition to Refurbished.
  9. Click Save.

Currently, the Merchandise object uses its system default compact layout, which only has the Merchandise Name field assigned. Here’s what our iPhone 4 record looks like in Salesforce1:

iPhone5s Detail Before

Let’s add more fields alongside that “iPhone4” so our mobile users can see more pertinent information right at the top of the Merchandise record pages.

  1. In Setup, click Create | Objects.

    Merchandise is a custom object. If we were creating a custom compact layout for a standard object, the path in Setup would be Customize | Object | Compact Layouts.

    Tip

  2. Click the Merchandise object name.
  3. Scroll down to the Compact Layouts related list and click New.
  4. In the Label field, enter Customized Compact Layout.
  5. Select these fields for the compact layout, then click Add.
    When on site, these are the most important fields for our mobile technicians to see. You can select and add them individually or select them as a group using CTRL-click.
    • Condition
    • Merchandise Name
    • Price
    • Quantity
  6. Using the Up or Down buttons, adjust the list so that the fields are in this order: Merchandise Name, Quantity, Condition, Price.
  7. Click Save.
    Now we need to set our compact layout as the primary.
  8. Click Compact Layout Assignment.
    You can see that the primary compact layout is set to the System Default here. We need to change that.
  9. Click Edit Assignment.
  10. Select the compact layout you just created to use as the primary compact layout.
  11. Click Save.

We’ve customized a compact layout for the Merchandise object. Now let’s see what its related information page looks like in Salesforce1.