Create a Travel Approval Object
In the previous steps, you created the travel app using Lightning App Builder and created the first custom object for Departments. Now you create the object to store the Travel Approval requests.
- Navigate back to Object Manager.
- Click Create then select Custom Object.
- Enter these details:
Parameter Value Label
Travel_Approval (this field auto-populates)
Travel Approval #
Don’t click Save yet. You need to set a few more parameters first. Scroll down and select these additional options.
- Allow Reports
- Allow Activities
- Track Field History
- Allow Search
- Add notes and Attachments related list to default page layout
- Launch New Custom Tab Wizard after saving this custom object. Note: Be sure to check this box as it drives the next screens that will show. If you miss this option, you can create a custom tab by going to Setup, searching for and selecting Tabs, then creating a new tab after your object has been created.
- Click Save.
- Click next to Tab Style and select Airplane.
- Click Next.
- Keep the Add to profiles screen as is, and click Next.
- In the Add to Custom Apps screen, select the Include Tab checkbox to deselect all apps. Select Travel App, then click Save.
- On the object configuration page, click Fields & Relationships, then click New.
- Select Text Area as the data type, then click Next.
- For Field Label, enter
Purpose of Trip.
- Click Next.
- Leave the Establish field-level security screen as is, and click Next.
- Keep the Add to page layouts screen as is, and click Save.
To create the remaining fields for the Travel Approval object, repeat step 9 to begin, then follow the parameters below.
- Create the Status field with a Picklist data type. Click Enter values, with each value separated by a new line. Use the following values:
- Create the Trip Start Date field with a Date data type.
- Create the Trip End Date field with a Date data type.
- Create the Out-of-State field with a Checkbox data type.
- Create the Destination State field with a Text data type. Set the text Length to 2.
- Create the Department field with a Lookup Relationship data type, then select Department for the Related To field. Click Next 4 times, then Save.
You’ve just created the Travel Approval object and created a lookup relationship to the Department object. In the next step, you create the Expense Item object, where each expense line item for the travel request is created.