Module 11: Creating a Child Record with an Object Action

Object Actions provide a way to quickly access common tasks related to a specific object. In this module, you create an Object Action for the Expense Report object. The action allows the user to create a new expense for the current expense report.

Step 1: Create the Object Action

  1. In Setup, select Build > Create > Objects and click the Expense Report link

  2. In the Buttons, Links, and Actions section, click New Action, and define the Action as follows:

    • Action Type: Create a Record
    • Target Object: Expense
    • Standard Label Type: --None--
    • Label: Add Expense
    • Name: Add_Expense

  3. Click Save

  4. Drag the Category field to the Layout (before Amount)

  5. Click Save (upper left)

Step 2: Modify the Publisher Actions Layout

  1. In Setup, select Build > Create > Objects and click the Expense Report link

  2. In the Page Layouts section, click the Edit link to the left of Expense Report Layout

  3. In the Publisher Actions section, click the override the global publisher layout link

  4. Click Actions, drag the Add Expense action to the Publisher Actions section (before Post), and click Save

Step 3: Test the Application

  1. Tap the menu icon (upper left corner)

  2. In the menu, tap Expense Reports under Recent

  3. Tap an expense report in the list

  4. Tap the publisher button (lower right corner)

  5. Tap Add Expense

  6. Enter an expense

    Notice that Expense Report is automatically populated.

  7. Click Submit (upper right corner)

  8. On the Expense Report details screen, swipe left

  9. Tap Expenses

  10. Pull to refresh the list

comments powered by Disqus