Вы находитесь на странице: 1из 5

Chapter 4: Building a Simple App

Becoming Familiar with the Setup Area


Since we're going to spend most of our time working in the Setup area of the platform, let's
first become familiar with what it is and how to navigate to it.

The Setup area is a user preferences area, an application building and customization
environment, and an administration tool, all in one. We perform almost every task we need
to create our app in the Setup area, so most of the Try It Out sections of the book are going
to start with an instruction like, Click Your Name Setup Create Apps. This is a
short way of saying:

1. Click the Your Name Setup link in the top-right corner of the page (shown in
the following screenshot).
2. Go to the App Setup area on the left side of the page.
3. Click the + icon to expand the Create menu, or just click the Create link.
4. Click the Apps link.

The final link that you click (in this example, Apps) will change depending on the task you're
trying to perform, but you get the general idea.

Figure 9: The Setup Area

Similar to the other parts of the application, the Setup area consists of a tab bar, a navigational
sidebar, and a main window:

30
Building a Simple App

The tab bar is made up of the same tabs that appear in the regular application. Just click
on any one of the tabs to exit the Setup area and go to that tab in the main application.
The navigational sidebar includes expandable lists of all the tools that are available in the
Setup area:
Personal Setup
These tools control individual preferences and are available to all users.
App Setup
These tools configure the standard objects, custom objects, and custom
apps that are deployed and are typically used only by administrators.
Administration Setup
These tools configure the platform as a whole and are typically used
only by administrators.
Force.com Checkout
These tools let you purchase licenses and products from salesforce.com,
change your billing information, and so forth.
The main window is where the navigational links or a selected setup tool are actually
displayed.

Now that we know what we're looking at, let's start creating our simple app.

Introducing Apps
What should we do first? If we were writing a software application, the first thing we'd need
to do is build a project where we could store all the code that we were going to write. With
the Force.com platform, the first thing we need to do is create a new app.

Like a programming project, an app is little more than a container for all of the objects, tabs,
and other functionality that we're going to build as part of our Recruiting application. It consists
simply of a name, a logo, and an ordered set of tabs. The simplest app contains only one
tabthe Home taband a default logo. As we define more tabs in the remainder of this book,
we can add them to the app later.

Let's start clicking through the process of actually creating a simple app now. Log in to your
Salesforce.com account so you can follow along!

Note: Because the platform is continually evolving, you might find that the screenshots
you see in this book vary slightly from what you see on your screen. These changes
should be minor and shouldn't affect your understanding.

31
Chapter 4: Building a Simple App

Try It Out: Defining an App


To create an app:

1. Open a browser and go to www.salesforce.com.


2. Click Customer Login.
3. Enter your username and password.
4. Click Your Name Setup Create Apps.
5. If you see an introductory splash page, simply click Continue.
Note: You'll find that many parts of the application have these splash pages
to help you understand what you can do with the platform. If you never
want to see a particular page again, just click Don't show me this page again.

Welcome to the Apps list page! Like many of the setup tools, the starting page for the Apps
tool consists of a list of all the apps that are currently enabled for your organization. Depending
on what edition you're using or what you've already installed from the AppExchange, you'll
probably already have some standard apps listed here.

6. Click New. The New Custom App wizard appears.


7. In the App Label field, enter Recruiting.

The app label is the name that will represent our new app in the Force.com app menu that
appears at the top right of all pages. Users can use this menu to switch back and forth between
apps.

Notice that a vertical red bar appears just to the left of this Label field. This red bar indicates
that you must provide a value for this field in order to save your work. If you don't enter a value
here and try to proceed, an error message is displayed, as shown in the following screenshot.

Figure 10: Required Fields Highlighted in Red

32
Building a Simple App

8. Click your mouse inside the App Name field.

The app name is what the developers use to identify an app when writing code for the Force.com
platform. We won't be doing anything in this book that uses the app name, but the field is
required, so it needs a value. Fortunately, when you enter a value in the App Label field, the
same value should automatically appear in the App Name field. If it doesn't, enter Recruiting
in the App Name field now.

9. In the Description field, enter Manage positions, candidates, and


job applications, and track job postings on employment
websites.
10. Click Next.
The next screen in the New Custom App wizard allows you to specify the image file that
should be used for this app's logo. Whenever the app is selected in the Force.com app menu,
this is the logo that appears in the upper-left corner of all pages. Since we're just creating a
simple app, let's accept the default logo that's already provided. We can always change it later.

11. Click Next.

As we said before, an app is a container for an ordered collection of tabs, and this step of the
New Custom App wizard allows us to specify which tabs we want to include in our new app.
The Available Tabs list shows us the standard and custom tabs that are available for us to
choose, and the Selected Tabs list shows us which tabs are already included, listed in the
order that they should be displayed. You'll notice that one tab, the Home tab, is already included
in our app by default. This is because the Home tab is required in every app, and must always
be in the first position; however, you can use the Default Landing Tab drop-down menu
to select which tab is first displayed when the app opens.

Again, since we're just creating a simple app, let's accept the defaults and move on. We'll add
more tabs later.

12. Click Next.


Now that we've defined some of the basic features of our app, you might be wondering what
remains to be done in the New Custom App wizardshouldn't we already be done? It turns
out that one crucial step remains: we need to define the users who will be allowed to access
our app.

In this step of the New Custom App wizard, we can choose which user profiles should have
access to the app. We'll learn more about profiles in Securing and Sharing Data on page 129.
For now, just understand that every user is assigned to a profile, and profiles control which
apps the users assigned to that profile can view.

33
Chapter 4: Building a Simple App

13. Select the Visible checkbox next to the Standard User and System Administrator
profiles.
14. Click Save.

That's it!

Look at What We've Done


Now that we've made it back to the Apps list page, let's see what we've just done. First of all,
we've got a new entry in the Apps listour Recruiting app! It shows up in the list in the same
order it's going to appear in our Force.com app menu. In fact, let's go look at the Force.com
app menu now.

Figure 11: Force.com App Menu

Tip: If you want to change the position of our app in this menu, do so from the Apps
list page by clicking Reorder and rearranging the available apps as you see fit.

Now select the Recruiting app from the menu and see what happensour app is launched
with a single Home tab! We've created the Recruiting app's Home tab, and we've added it to
the Force.com app menu. That's how easy it is to get started.

You'll notice that the approach we're taking here is iterative: we'll build part of the app, look
at what we've accomplished, and then add to it. This sequence not only reflects the fact that
we're leading you through the steps of building an app in this book, but you'll also find that
in building Force.com platform apps in general, this iterative process is common.

During the course of this book, you'll also notice that unlike with traditional coding projects,
your app is always functional. There's no build or compile phase, and as a result, you'll almost
never be chasing down syntax bugs or other typos. In fact, with this simple one-tab app, you
can already utilize all of the built-in functionality that comes with the platform, including
search, calendar events and tasks, user preferences, and a familiar user interface.

34

Вам также может понравиться