Create a Travel Approval Object
In the previous units, 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 |
Plural Label |
Travel Approvals |
Object Name |
Travel_Approval (this field auto-populates) |
Record Name |
Travel Approval # |
Data Type |
Auto Number |
Display Format |
TA-{00000} |
Starting Number |
1 |
- 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 & New to create more custom fields.
To create the remaining fields for the Travel Approval object, follow the parameters below.
- Create the
Statusfield with a Picklist data type. Click Enter values, with each value separated by a new line. Use these values:
NewSubmittedPending ApprovalApprovedRejectedDraft
- Create the
Trip Start Datefield with a Date data type.
- Create the
Trip End Datefield with a Date data type.
- Create the
Out-of-Statefield with a Checkbox data type.
- Create the
Destination Statefield with a Text data type. Set the text Length to2.
- Create the
Departmentfield with a Lookup Relationship data type, then select Department for the Related To field. Click Next 4 times, then Save.
You 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.