To make the Warehouse app more realistic, you need invoices to track orders going in and out of the warehouse. When you created the app, the wizard created the Merchandise object for you. In this tutorial, you learn how to extend the app further:

  1. Create another custom object, one for keeping track of invoices.
  2. Add a navigation tab to the app that lets users work with invoices.

Prerequisites

You must complete all previous tutorials in this series, starting with Quick Tutorial 1: Build a Cloud App in 5 Minutes.

Step 1: Create the Invoice Object Using the Wizard

Log into your DE org, click <your_name> | Setup. Under App Setup, click Create | Objects, and then click New Custom Object. Fill in the form as follows:


Qs3 co.png


Every time someone creates a new invoice, you want the record to have a unique identifier: INV-0001, INV-0002, and so on. That's easy — just set the data type for the standard Name field to Auto Number. Then fill in the rest of the fields as follows and click Save.


Qs3 invoice number.png

Step 2: Add an Invoice Tab to the App

When you click on the Merchandise tab, a list of Merchandise records appears. Similarly, you need to create a tab that displays Invoices.

Because you selected Launch New Custom Tab Wizard ... in the previous step, you should now be looking at that wizard (if you're not here for some reason, just click <your_name> | Setup | Create | Tabs and click New).

To create a new app tab for invoices:

  1. In the Tab Style lookup, choose Form.
  2. Click Next and Next again to accept the default tab visibility settings.
  3. It only makes sense to display this new tab for the Warehouse app. So on the Add to Custom Apps page, clear the checkbox next to all apps except Warehouse and click Save.

Step 3: Reorder Tabs in the App

Take a look at the tabs across the top of your screen and you'll see the new Merchandise tab isn't next to the Invoice tab. That's not correct, but easy to fix. You can put tabs in any order you like.

  1. The Setup menu on the left should already be open, if not click <your_name> | Setup | Create | Apps and click the Edit link next to your Warehouse app.
  2. In the Selected Tabs list, click Invoices and use the up arrow to move it under Merchandise.
  3. Click Save.

Take a look at the tabs now.


Qs3 tab order.png

Step 4: Add a Status Field to the Invoice Object

If you try to create an invoice now, you won't be impressed. There're no fields that you can modify because they are all standard, auto-managed fields. In this step, you extend the Invoice object to add a new Status picklist field to track the status of each invoice.

  1. The setup menu should already be open — if not click <your_name> | Setup.
  2. Click Create | Objects and then click Invoice.
  3. Scroll down to the Custom Fields and Relationships section and click New.
  4. For the data type, select Picklist and then click Next.
  5. Fill in the custom field details as in the screen below.
  6. Leave the defaults for the remaining fields, and click Next, Next and Save.


Qs3 picklist.png


Before moving on to the next step, take a look at the Help text in the screen above. This is another nice feature of the platform to be aware of. When users hover their pointer over the Status field, a pop-up bubble appears with whatever help text you specify. Although it's beyond the scope of our quick tutorial, understand that you can easily create unique translations for app labels and help text so that the app supports multiple languages, again, without building a single line of code. Very cool.

Step 5: Try Out the App

Although your app isn't completely done yet, you can create invoices and save them. It's not a problem that the invoice is still missing some fields, because when you add more fields to the Inventory object, the new fields will automatically appear on the records that already exist.

  1. Click the Invoices tab.
  2. Click New to create a new invoice. Notice that you can choose a status for the invoice, but leave it as Open.
  3. Click Save.

Click the Invoices tab again and notice there's a new invoice, with the number INV-0001. Create another one with a Closed status.


Qs3 tabs.png

Tell Me More

You only have a few records so far, but how would the page look if you had hundreds of records? Thankfully, the default list view for a tab shows you only the most recent records you've touched and lets you page through sets with standard navigation controls.

Another feature to be aware of is views. A view is a customized presentation of data that shows only the fields you want, based on filters you define. For example, suppose you are only interested in open invoices with a price greater than $1000. You can create a custom view that shows exactly those records. It's a bit beyond the scope of this tutorial to go through that now, but if you're feeling up to the challenge, click Create New View and make one for yourself.

Next Steps

The database is starting to look better. But it's still incomplete. In the next tutorial, you will add another object, Line Items, and then relate it to other objects.