Salesforce Creating On Demand Apps
Salesforce Creating On Demand Apps
Copyright 20002014 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark
of salesforce.com, inc., as are other names and marks. Other marks appearing herein may be
trademarks of their respective owners.
Various trademarks held by their respective owners.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the
prior consent of the publisher.
ISBN: 978-0-9789639-3-4
Force.com Fundamentals is an introduction to the native functionality of the Force.com platform. This
book walks the reader through the creation of a standard recruiting application, including designing
and creating Force.com objects, modifying the appearance of the standard Force.com interface, the
Force.com security scheme, collaborating with Chatter, reporting on your data, and using workflows
and approvals. This book also introduces the use of Visualforce pages integrate external functionality.
Table of Contents
Preface......................................................................................................1
Welcome to the Cloud!....................................................................................................1
Platforms for Cloud Computing...........................................................................2
About This Book..............................................................................................................2
Intended Audience................................................................................................3
Chapter Contents.................................................................................................3
Choosing Your Development Environment.........................................................4
Sending Feedback.................................................................................................5
About Developer Force.....................................................................................................5
Salesforce.com Training & Certification..........................................................................5
Introducing the Force.com Platform..........................................................7
Chapter 1: Introducing the Force.com Platform.................................7
The Basics of an App's User Interface..................................................................9
The Benefits of a Force.com Platform App........................................................11
Data-Centric Apps.................................................................................11
Collaborative Apps..................................................................................12
The Technologies Behind a Force.com Platform App.......................................13
A Multitenant Architecture....................................................................14
A Metadata-Driven Development Model...............................................15
APIs........................................................................................................16
Apex........................................................................................................16
Visualforce...............................................................................................16
Mobile Access.........................................................................................17
The AppExchange Directory..................................................................18
Chapter 2: About the Sample Recruiting App...........................................19
About Universal Containers...........................................................................................20
Considerations for the Recruiting App...........................................................................20
Building the App: Our Design.......................................................................................21
Custom Objects..................................................................................................21
Security and Sharing Rules.................................................................................22
i
Table of Contents
Workflow and Approval Processes.....................................................................22
Custom Reports and Dashboards.......................................................................24
Visualforce..........................................................................................................24
Chapter 3: Reviewing Database Concepts.................................................25
What's a Database?.........................................................................................................27
What's in a Database?.....................................................................................................28
What's a Relational Database?........................................................................................29
Summary of Database Concepts.....................................................................................31
Chapter 4: Building a Simple App............................................................33
Becoming Familiar with the Setup Area.........................................................................34
Introducing Apps............................................................................................................36
Try It Out: Define an App.................................................................................36
Look at What We've Done.................................................................................39
Introducing Objects........................................................................................................40
The Position Custom Object..............................................................................40
Try It Out: Define the Position Custom Object................................................40
Introducing Tabs............................................................................................................44
Try It Out: Define the Positions Tab.................................................................44
Look at What We've Done.................................................................................46
Becoming Familiar with Setup Detail Pages and Related Lists......................................48
Introducing Fields...........................................................................................................50
Try It Out: Add Text Fields...............................................................................51
Try It Out: Add Currency Fields........................................................................54
Try It Out: Add Checkbox Fields.......................................................................54
Try It Out: Add Date Fields...............................................................................55
Look at What We've Done............................................................................................55
Taking Our Simple App Mobile....................................................................................56
Chapter 5: Enhancing the Simple App with Advanced Fields, Data
Validation, and Page Layouts...............................................................59
Adding Advanced Fields................................................................................................60
Introducing Picklists...........................................................................................60
Try It Out: Add Picklists....................................................................................60
Introducing Field Dependencies.........................................................................63
Try It Out: Create a Dependent Picklist............................................................64
ii
Table of Contents
Look at What We've Done.................................................................................67
Introducing Custom Formula Fields..................................................................68
Calculating How Long a Position Has Been Open............................................69
Try It Out: Define a Days Open Custom Formula Field................................70
Try It Out: Give Fields Dynamic Default Values...............................................74
Look at What We've Done.................................................................................75
Introducing Validation Rules..........................................................................................76
Try It Out: Define a Validation Rule for Min and Max Pay..............................76
Try It Out: Define a Validation Rule for Close Date.........................................78
Look at What We've Done.................................................................................80
Check It Out in Mobile..................................................................................................82
Introducing Page Layouts...............................................................................................83
Becoming Familiar with the Page Layout Editor...............................................84
Try It Out: Group Fields into a New Section.....................................................85
Try It Out: Add Spaces Between Fields.............................................................88
Try It Out: Edit Field Properties........................................................................89
Look at What We've Done.................................................................................90
Taking Your Page Layouts Mobile.....................................................................92
Introducing Compact Layouts........................................................................................96
Chapter 6: Expanding the Simple App Using Relationships.....................101
Introducing Relationships.............................................................................................102
Introducing Relationship Custom Fields......................................................................103
Try It Out: Relate Hiring Managers to Positions.............................................104
Look at What We've Done...............................................................................104
Adding Candidates to the Mix.....................................................................................106
Try It Out: Create the Candidate Object.........................................................106
Try It Out: Add Fields to the Candidate Object..............................................107
Try It Out: Modify the Candidate Page Layout Properties..............................108
Look at What We've Done...............................................................................110
Try It Out: Customize the Candidate Record Highlights................................111
Look At What We've Done.............................................................................111
Bringing Candidates and Positions Together with Job Applications...........................115
Try It Out: Create the Job Application Object.................................................113
Try It Out: Add Fields to the Job Application Object......................................114
Try It Out: Customize the Job Application Record Highlights.......................115
Look at What We've Done...............................................................................116
iii
Table of Contents
Introducing Search Layouts..........................................................................................117
Try It Out: Add Fields to the Candidate Lookup Dialog................................119
Try It Out: Update Additional Search Layouts................................................120
Managing Review Assessments....................................................................................121
Try It Out: Create the Review Object..............................................................122
Try It Out: Add Fields to the Review Object...................................................123
Introducing Roll-Up Summary Fields..............................................................129
Try It Out: Create Roll-Up Summary Fields...................................................129
Try It Out: Customize the Review Object's Page and Search Layouts.............131
Try It Out: Customize Record Highlights for Reviews....................................132
Look at What We've Done...............................................................................133
Creating a Many-to-Many Relationship......................................................................134
Try It Out: Create the Employment Website Object.......................................136
Try It Out: Add the URL Field to the Employment Website Object..............137
Try It Out: Create the Job Posting Object.......................................................137
Try It Out: Add Fields to the Job Posting Object............................................138
Customizing Related Lists in a Many-to-Many Relationship..........................140
Try It Out: Customize the Positions and Employment Websites Related
Lists.............................................................................................................140
Try It Out: Customize Record Highlights for Employment Websites and
Job Postings.................................................................................................142
Look at What We've Done...............................................................................142
Putting it All Together.................................................................................................143
Try It Out: Download Sample Data.................................................................145
Try It Out: Use the Import Wizard..................................................................146
Chapter 7: Securing and Sharing Data....................................................149
Controlling Access to Data in Our App.......................................................................151
Required Permissions for the Recruiter............................................................151
Required Permissions for the Hiring Manager.................................................152
Required Permissions for the Interviewer.........................................................154
Required Permissions for the Standard Employee............................................155
So Where Are We Now?..................................................................................156
Data Access Concepts..................................................................................................157
Controlling Access to Objects......................................................................................158
Introducing Profiles..........................................................................................159
Standard Profiles...............................................................................................159
iv
Table of Contents
Introducing Permission Sets.............................................................................160
Profiles and Permission Sets in Our Recruiting App........................................161
Try It Out: Create the Recruiter Profile...........................................................162
Try It Out: Create the Standard Employee Profile...........................................166
Try It Out: Create the Hiring Manager Permission Set...................................167
Try It Out: Create the Interviewer Permission Set...........................................172
Controlling Access to Fields.........................................................................................174
Introducing Field-Level Security......................................................................175
Field-Level Security in Our Recruiting App....................................................175
Try It Out: Limit Access to Fields in the Standard Employee Profile.............176
Try It Out: Check Field-Level Security in Permission Sets.............................179
Controlling Access to Records......................................................................................180
Introducing Organization-Wide Defaults........................................................180
Org-Wide Defaults in Our Recruiting App.....................................................180
Try It Out: Set Org-Wide Defaults..................................................................183
Introducing Role Hierarchies............................................................................185
Comparing Roles, Profiles, and Permission Sets..............................................186
Role Hierarchies in Our Recruiting App..........................................................186
Try It Out: Create a User.................................................................................187
Try It Out: Define a Role Hierarchy................................................................188
What's Left to be Shared?.................................................................................192
Introducing Sharing Rules................................................................................192
Sharing Rules in Our Recruiting App..............................................................192
Try It Out: Define a Public Group...................................................................193
Try It Out: Define Sharing Rules.....................................................................195
Introducing Manual Sharing.............................................................................197
Try It Out: Define a Manual Sharing Rule......................................................198
Displaying Field Values and Page Layouts According to Profiles................................199
Try It Out: Create a Record Type....................................................................200
Putting It All Together.................................................................................................203
Try It Out: Create More Users.........................................................................203
Try It Out: Verify that Everything Works........................................................207
Delegating Data Administration..................................................................................208
Overriding Sharing with Object Permissions...................................................209
Delegated Administration Groups....................................................................210
Try It Out: Define the Recruiting Manager Administration Group................211
v
Table of Contents
Try It Out: Verify that Delegated Administration Works................................213
Summing Up................................................................................................................214
Chapter 8: Collaborating with Chatter....................................................215
Introducing Chatter......................................................................................................216
Tracking Fields on Your Objects..................................................................................216
Try It Out: Enable Feed Tracking on Positions and Job Applications.............216
Look At What Weve Done.............................................................................218
Following Records........................................................................................................220
Try It Out: Follow a Job Application Record...................................................220
Starting a Group or Two..............................................................................................221
Try It Out: Create a Group..............................................................................221
Introducing Notifications.............................................................................................222
Try It Out: Enable Notifications......................................................................223
Look At What Weve Done.............................................................................223
Introducing Publisher Actions......................................................................................224
Try It Out: Create a Global Action..................................................................225
Introducing Action Layouts..................................................................226
Try It Out: Add Predefined Field Values.............................................228
Try It Out: Create More Global Actions..............................................229
Introducing Global Publisher Layouts..............................................................229
Try It Out: Customize a Global Publisher Layout...............................230
Look At What Weve Done..................................................................231
Introducing Object-Specific Actions................................................................232
Try It Out: Create an Object-Specific Action......................................232
Try It Out: Create More Object-Specific Actions................................233
Try It Out: Assign Object-Specific Actions to Page Layouts...........................235
Look At What Weve Done.............................................................................237
Summing Up................................................................................................................239
Chapter 9: Using Custom Workflow and Approval Processes...................241
Introducing Workflow..................................................................................................242
Introducing Workflow Rules............................................................................243
Introducing Workflow Actions.........................................................................243
Workflow in Our Recruiting App................................................................................244
Creating Workflow Rules That Assign Tasks..............................................................245
Try It Out: Create the Send Rejection Letter Workflow Rule......................246
vi
Table of Contents
Try It Out: Create the Send Rejection Letter Workflow Task......................249
Try It Out: Create the Extend an Offer Workflow Rule and Task...............251
Look at What We've Done...............................................................................252
Creating a Workflow Rule That Updates Fields..........................................................254
Introducing Queues..........................................................................................254
Try It Out: Create a Queue for Positions.........................................................254
Try It Out: Create a Workflow Rule That Updates Fields...............................257
Introducing Time-Dependent Workflow Actions............................................258
Try It Out: Create the Notify Recruiting Manager Time-Dependent
Workflow Task...........................................................................................258
Look At What We've Done.............................................................................260
Creating a Workflow Rule That Sends Email Alerts...................................................262
Introducing Email Templates...........................................................................262
Try It Out: Build an Email Template...............................................................263
Try It Out: Create the New Position Workflow Rule and Alert......................266
Introducing Approvals..................................................................................................268
Planning for Approval Processes.......................................................................269
Try It Out: Create an Email Template for Approvals......................................270
Try It Out: Create an Approval Process...........................................................270
Try It Out: Create Approval Steps...................................................................274
Try It Out: Create Approval Actions................................................................278
Try It Out: Activate Our Approval Process......................................................281
Look At What We've Done.............................................................................281
Summing Up................................................................................................................285
Chapter 10: Analyzing Data with Reports and Dashboards......................287
Introducing Reports......................................................................................................288
Report Formats.................................................................................................289
Setting Up the Recruiting App for Reports......................................................293
Try It Out: Add the Reports Tab.........................................................293
Try It Out: Create a Recruiting Reports Folder...................................293
Creating a Summary Report.............................................................................295
Try It Out: Create a Summary Report..................................................295
Try It Out: Add Columns and Filters...................................................299
Try It Out: Add a Pie Chart.................................................................301
Creating a Matrix Report..................................................................................303
Try It Out: Create a Matrix Report......................................................303
vii
Table of Contents
Try It Out: Add Summary Fields.........................................................304
Try It Out: Add Columns and Filters...................................................306
Try It Out: Add a Chart and Conditional Highlighting......................308
Introducing Dashboards...............................................................................................311
Try It Out: Create Additional Reports.............................................................312
Try It Out: Create a Dashboard.......................................................................315
Adding Dashboard Components......................................................................317
Try It Out: Add a Chart Component...................................................318
Try It Out: Add a Gauge Component..................................................319
Try It Out: Add a Table Component...................................................320
Try It Out: Add a Metric Component..................................................321
Refreshing Dashboards.....................................................................................323
Introducing Mobile Dashboards.......................................................................324
Introducing Custom Report Types...............................................................................325
Try It Out: Create a Report Type.....................................................................326
Look At What We've Done.........................................................................................330
Chapter 11: Moving Beyond Point-and-Click App Development............333
Introducing Mash-Ups and Web Services....................................................................335
Introducing Visualforce................................................................................................336
Introducing Visualforce Development Mode....................................................338
Try It Out: Enabling Visualforce Development Mode.....................................339
Implementing the Candidate Map ..............................................................................339
Try It Out: Create a Visualforce Page..............................................................339
Try It Out: Write Visualforce Markup.............................................................341
Try It Out: Add the Map to Our Visualforce Page..........................................344
Try It Out: Add the Candidate Map to Position Page Layouts.......................345
Try It Out: Enable the Candidate Map for Mobile..........................................346
Try It Out: Test the Candidate Map................................................................347
Implementing the Mass Update Status Button............................................................348
Planning the Mass Update Status Feature........................................................349
Try It Out: Create the Mass Update Status Page.............................................350
Understanding the MassUpdateStatus Visualforce Markup.............................352
Try It Out: Create a Custom List Button.........................................................355
Try It Out: Add a Custom List Button to a Page Layout................................357
Try It Out: Test the Mass Update Status Feature............................................358
viii
Table of Contents
Chapter 12: Learning More....................................................................361
Developer Force............................................................................................................362
Help and Training Options..........................................................................................362
Multimedia...................................................................................................................363
AppExchange Partner Program....................................................................................363
What Do You Think?...................................................................................................363
Glossary................................................................................................365
Index.....................................................................................................389
ix
Table of Contents
Preface
As users of the Internet, we're all familiar with the fascinating, innovative, creative, and
sometimes silly ways in which it has changed how we work and play. From social networking
sites to wikis to blogs, and more, its exciting to watch the innovations taking place that are
changing the ways we communicate and collaborate.
While these changes have certainly impacted how we work with content, a similar set of
Internet-driven ideas and technologies is changing how we build and work with business
applications. While yesterday's business applications required thousands, if not millions, of
dollars and sometimes years of professional services help to set up and customize, the
technologies offered by the Internet today make it much easier to create, configure, and use
business applications of all kinds. Indeed, the power of the Internet has given us the ability to
solve new kinds of business problems that, because of complexity or cost, had previously
remained out of reach.
Just as the changes that moved publishing technology from paper to bits made it possible for
us to have information about anything in the whole world right at our fingertips, the changes
in application technology make it similarly possible to imagine a robust, enterprise-class
application for almost any business need. Sound pretty good? Then you're probably wondering:
What's the magic that makes this possible?
Welcome to the Cloud!
These new ways of building and running applications are enabled by the world of cloud
computing, where you access applications, or apps, over the Internet as utilities, rather than as
pieces of software running on your desktop or in the server room. This model is already quite
common for consumer apps like email and photo sharing, and for certain business applications,
like customer relationship management (CRM).
1
Because almost all apps these days are delivered via a Web browser, it's increasingly hard to
tell which applications are traditional software, and which are run in the cloud. As with the
Internet, applications that run in the cloud have grown so ubiquitous that almost every business
user interacts with at least one, whether it's an email service, a Web conferencing application,
or a sales system.
Platforms for Cloud Computing
A new twist, the platform in the cloud, is making the delivery of application functionality even
more interesting. Increasingly, applications that run in the cloud are starting to look less like
websites and more like platforms, meaning they are starting to sprout Application Programming
Interfaces (APIs), code libraries, and even programming models. Collectively, these new kinds
of development technologies can be thought of as platforms to run apps in the cloud.
Similar to traditional platforms, cloud computing platforms provide tools that allow developers
to leverage existing functionality to create something new; however, because these platform
tools are accessed freely over the Internet rather than through an operating system or package
that was installed on a local machine, developers don't need to worry about the logistics of
putting together an executable that will be installed on a user's machine. Anyone with a Web
browser can access the app!
The possibilities presented by this new type of platform have emerged quickly, spurred on by
the popularity of mash-upsa website or application that combines tools from multiple cloud
computing platforms to create new functionality. Some of the cloud computing platform tools
used in today's mash-ups include innovations like Google's search API, which allows developers
to use the power of that search engine in their applications, eBay's APIs for auctions and
listings, or Amazon.com's system for creating entirely new storefronts. For example, almost
any real estate website or application these days uses Google or Yahoo! maps under the hood,
illustrating how these new APIs are now commonly running alongside the more traditional
database, app server, or operating system platforms.
About This Book
This book introduces you to the Force.com platform, salesforce.com's platform for building
and running business applications in the cloud.
To illustrate the technologies available on the Force.com platform, and to show you just how
easy it is to create your own business application with the platform, this book walks you through
the process of creating a new recruiting application that runs in the cloud. To follow along you
won't need to learn any programming languages or hack your way through cryptic configuration
2
Chapter 1: Preface
documentsinstead, you'll just need to point-and-click your way through a Web interface,
following the easy step-by-step instructions in the book.
Note: Want an online version of this book? Go to
http://wiki.developerforce.com/page/Force_Platform_Fundamentals.
Intended Audience
This book can be easily understood by anyone from a business user to a professional developer.
However, to get the most out of the book, it helps to be familiar with basic Internet and
database concepts, such as tables and fields.
While the book focuses primarily on using the declarative, point-and-click functionality of the
Force.com platform, Moving Beyond Point-and-Click App Development on page 333 introduces
you to the platform's user interface programming tools. To fully understand that chapter, you
should be familiar with HTML and JavaScript. However, all the code you need is provided,
so even if you're not an experienced developer, you can still follow along to gain a deeper
understanding of what can be done with the Force.com platform.
Chapter Contents
If you're already familiar with the Force.com platform, you can skip around to the chapters in
which you're most interested:
Description Chapter
Learn about the technologies behind the
Force.com platform, including the
AppExchange directory.
Introducing the Force.com Platform
Learn about the recruiting application that
we'll be building in this book and the fictitious
company for whom we'll be building it.
About the Sample Recruiting App
Review database concepts such as tables,
records, fields, keys, and relationships.
Reviewing Database Concepts
Create the first custom object in our recruiting
app, and add several basic fields.
Building a Simple App
Add picklists, dependent picklists, validation
rules, and formula fields to the custom object,
Enhancing the Simple App with Advanced
Fields, Data Validation, and Page Layouts
3
Chapter 1: Preface
Description Chapter
and then edit the layout of the object's detail
page.
Add five more custom objects to our recruiting
app, and associate them with one another
using relationships.
Expanding the Simple App Using
Relationships
Set up rules for who can read, create, edit, and
delete records in the app.
Securing and Sharing Data
Enable Chatter for your organization so users
can keep up with the information they care
about.
Collaborating with Chatter
Define workflow rules and approval processes
that assign tasks, update fields, and send
emails when certain criteria are met.
Using Custom Workflow and Approval
Processes
Create custom reports, charts, and dashboards
that give users a bird's-eye view of recruiting
data.
Analyzing Data with Reports and Dashboards
Learn how to use Visualforce to extend the
functionality of the platform by creating a
Moving Beyond Point-and-Click App
Development
mash-up with Yahoo! maps and adding a tool
for mass updating records.
Find out where you can get more information
about developing on the platform.
Learning More
Look up the definition of any term you find
unfamiliar.
Glossary
Note: This book contains lots of screenshots. Because the Force.com platform is a
rapidly developing platform, the screenshots might vary slightly from what you see
on the screen, but don't worry! These differences should be minor and won't affect
your understanding of the system.
Choosing Your Development Environment
To follow along with the exercises in this book, you'll need a Salesforce account. If you're
already a Salesforce customer, you can use a Force.com sandbox. A sandbox is a copy of your
4
Chapter 1: Preface
organization that you can use for testing configurations and training users without compromising
the data in your production organization. Salesforce Enterprise, Unlimited, and Performance
Editions come with one free sandbox; users of other editions can use Developer Edition to do
the exercises.
If you're new to Salesforce or if you don't want to use a sandbox, go to developer.force.com
and sign up for a free Developer Edition account. Developer Edition is a fully-functional
version of Salesforce that you can use to develop Salesforce apps. Since it's free, there are limits
on the amount of users, bandwidth, and storage you're allowed, but it includes all of the features
in Salesforce. When you sign up, you'll also automatically become part of the growing
community of Force.com platform developers around the world.
Sending Feedback
Questions or comments about anything you see in this book? Suggestions for topics that you'd
like to see covered in future versions? Go to the Developer Force discussion boards at
community.salesforce.com/sforce?category.id=developers and let us know
what you think! Or email us directly at [email protected].
About Developer Force
Developer Force is a community of developers who customize and build applications that run
in the cloud and are built with the Force.com platform. Developer Force members have access
to a full range of resources, including sample code, toolkits, an online developer community,
and the test environments necessary for building apps. The Developer Force website includes
an online version of this book and has information about the Dreamforce event that we hold
every year for Force.com platform developers. If you need more info, have a question to ask,
are seeking a toolkit or sample, or just want to dig a little deeper into Force.com platform
development, Developer Force is where it all comes together.
To find out more about the resources available on the Developer Force website, see
developer.force.com, and review the Learning More chapter.
Salesforce.com Training & Certification
A number of examples in this book have been provided by salesforce.com Training &
Certification and are drawn from the expert-led training courses available around the world.
Salesforce.com Training & Certification courses provide an opportunity to get hands-on
5
Chapter 1: Preface
experience with the Force.com platform and Salesforce applications, and prepare you to become
Salesforce certified. Register for courses at www.salesforce.com/training.
6
Chapter 1: Preface
INTRODUCING THE FORCE.COM PLATFORM
Chapter 1
Introducing the Force.com Platform
Force.com is a platform for creating and deploying
next-generation cloud apps. Because there are no servers
In this chapter ...
The Basics of an App's
User Interface
or software to buy or manage, you can focus solely on
building apps that include built-in social and mobile
The Benefits of a
Force.com Platform App
functionality, business processes, reporting, and search.
Your apps run on a secure, proven service that scales, tunes,
and backs up data automatically.
The Technologies Behind
a Force.com Platform App
Why use Force.com:
Proven More than 100,000+ companies trust
Force.com, including many industry leaders. Theyve
built 220,000+ apps that run in accredited, world-class
data centers with backup, failover, disaster-recovery,
and an uptime record exceeding 99.9%. You can see
real-time system performance data at
trust.salesforce.com.
Agile Force.com requires minimal coding. Assemble
your apps in building-block fashion using our visual
tools and library of components. Streamline
development with sandbox environments, and integrate
your apps using open APIs.
Social Work more effectively with your colleagues
using your own secure social network. Force.com
includes pre-built components for feeds, profiles,
conversations, updates, and file sharing. All components
7
are available through REST APIs that can be easily
integrated into any custom app.
Mobile Build native mobile apps powered by a
secure cloud database, with rock-solid APIs. Or build
mobile-optimized browser apps, using our UI
framework and HTML5 to support any device with
one code base. Or mix native and HTML in a hybrid
cocktail that gives you the best of both worlds.
Force.com has what you need to securely deliver apps
on mobile devices.
8
Chapter 1: Introducing the Force.com Platform
The Basics of an App's User Interface
You and your users may access Salesforce through two interfaces: the full Salesforce site, as
accessed from your desktop computer, and the mobile app. Throughout this guide, well walk
through tasks and see the impact of those customizations in both environments. If you haven't
used Salesforce before, you'll find it worthwhile to log in and spend a bit of time clicking around
both the full site and the mobile app. Most Salesforce editions (including Developer Edition)
have a basic Salesforce Sales app, so we'll start by looking at that. The interface for these tasks
has a lot in common with the interface of the app were planning to build.
Note: Haven't signed up for Developer Edition yet? Go to
www.developerforce.com/events/regular/registration.php.
Figure 1: Force.com Platform Apps Include Tabs, Forms, and Links
As you can see when you start clicking around, there are a few key elements that form the
foundation of the Sales app and of most applications created with the platform.
Tabs
Across the top of the app is a set of tabs that segment the app into different parts. Each
tab corresponds to a type of object, such as an account or contact, and within a tab you
can perform actions on particular records of that tab's type. For example, when you click
on the Accounts tab, you can create a new record for the Acme account. You can also
edit existing accounts, or use a list view to filter lists of accounts by certain criteria. Most
9
Chapter 1: Introducing the Force.com Platform
app development work revolves around creating tabs and defining the data and behaviors
that support them.
Fields
Displayed within each record is a selection of fields, which is how the Force.com platform
houses and organizes information. For example, a contact record includes fields such as
Last Name, Home Phone, Mailing City, Title, Birthdate, Reports To, and
Account. When developing a new app, you can customize which fields appear for a
given type of recordsuch as for contact recordsas well as how they are organized. In
a Force.com platform app, users enter information with writable fields on an edit page
and view that information with read-only fields on a detail page.
Links
Finally, because Force.com platform apps are delivered in a Web browser, they use links
to provide navigation to related data. For example, on an account detail page, there are
links to related records, such as the contacts who belong to the account and the sales user
who manages the account. Other links take you to recently visited records and to areas
of the app where users can set personal preferences. Links provide navigation within an
app and to external Web sites.
Now lets look at how these elements appear in a mobile context, like Salesforce1. We still see
collections of fields, and tapping links navigates us to the indicated record or external website.
That said, tabs dont exist in the mobile app.
Menu Items
Instead of tabs, mobile users access objects from items in the navigation menu. Like a
tab, each menu item in the Recent section corresponds to a type of object, such as an
account or contact. Objects are surfaced based on which objects youve viewed or worked
with recently. Tapping Show More displays all the objects available based on your profile
and permissions. When you tap one of these items, such as Accounts, you can create a
new record or look your recently visited records. To edit an existing record, you first need
to tap the record to open it.
Menu items also include things like Tasks, Dashboards, and the Feed, most of which
well talk about later in this guide.
10
Chapter 1: Introducing the Force.com Platform
Figure 2: Force.com Platform Apps in Mobile Include Menu Items, Forms, and Links
The Benefits of a Force.com Platform App
To better understand what the platform is best suited for, let's look beyond the core elements
of tabs, fields, and links, and into the types of applications they enable. Two huge benefits start
to come into focus when you look at Force.com platform apps: they're data-centric and
collaborative.
Data-Centric Apps
Because the platform is centered around a database, it allows you to write apps that are
data-centric. A data-centric app is an application that is based on structured, consistent
information such as you find in a database or XML file. We can find these data-centric apps
everywhere, in small desktop databases like Microsoft Access or FileMaker, all the way to the
huge systems running on database management systems like Oracle or MySQL. Unlike
11
Chapter 1: Introducing the Force.com Platform
applications that are built around unstructured data, like plain text documents or HTML files,
data-centric apps make it easy to control, access, and manage data.
For example, consider an exercise such as trying to determine the total sales for a month from
a set of Microsoft Word-based contracts versus a set of contracts in a simple database. Whereas
it takes a lot of effort to open each Word document, find the contract total, and then add them
all together, if this data is stored in the database of a data-centric app, we can more efficiently
get the same result by issuing a single query.
While most people don't need a data-centric application to keep track of anything other than
contacts, photos, or music, companies of all sizes constantly need to query and aggregate their
large amounts of data to make fast business decisions. As a result, the data-centric nature of
the Force.com platform makes it the perfect platform to build and host business applications.
Collaborative Apps
Because the platform can be accessed by multiple users at the same time, it allows you to write
apps that are collaborative. A collaborative app is an application with data and services that are
shared by multiple users in different locations. Unlike more traditional forms of software that
are installed on a single machine and are hard to access from a distance, collaborative apps on
the platform can be accessed from anywhere in the world with only a Web browser. This makes
it easy for teams to work together on activities like selling a product, managing a project, or
hiring an employee.
In addition to easy access over a Web browser, a number of built-in platform features also
facilitate productive group collaboration:
Use the platform's security and sharing model to finely control a user's access to different
data.
Use workflow rules to automatically assign tasks, update data, or send e-mail alerts when
certain business events occur, such as the creation of a new record or a change in the value
of a record field.
Use approval processes to set up a sequence of steps necessary for a record to be approved,
including who must approve it at each step.
Collectively, these features provide a framework for sharing apps across groups, divisions, and
entire corporations without relinquishing administrative control over sensitive data.
12
Chapter 1: Introducing the Force.com Platform
The Technologies Behind a Force.com Platform
App
Now that we've talked about the kinds of apps the platform can build, let's review some of the
technologies behind the platform. These technologies have a big impact on what the platform
supports and what it's like to develop on it.
Table 1: Key Technologies Behind the Platform
Description Technology
An application model in which all users and apps share a single,
common infrastructure and code base.
Multitenant
architecture
An app development model that allows apps to be defined as
declarative blueprints, with no code required. Data models, objects,
forms, workflows, and more are defined by metadata.
Metadata-driven
development model
Several application programming interfaces (APIs) provide direct
access to all data stored in Force.com from virtually any programming
language and platform.
API Access
The SOAP API and REST API integrate your organizations
data with other applications
The RESTful Bulk API (also available using Data Loader) loads
or deletes large numbers of records
The Metadata API manages customizations in your organization
(also available using the Force.com Migration Tool)
The Chatter REST API accesses Chatter feeds and social data
The Streaming API provides notifications reflecting data changes
in your organization
The worlds first on-demand programming language, which runs in
the cloud on the Force.com platform servers.
Apex
A framework for creating feature-rich user interfaces for apps in the
cloud.
Visualforce
With Salesforce mobile apps, you can access custom apps built using
the Force.com platforms point-and-click development tools. Your
Mobile Access
users can access those apps on their mobile devicesand you dont
have to learn any mobile programming languages.
13
Chapter 1: Introducing the Force.com Platform
Description Technology
A Web directory where hundreds of Force.com apps are available to
Salesforce customers to review, demo, comment upon, and/or install.
AppExchange
directory
Developers can submit their apps for listing on the AppExchange
directory if they want to share them with the community.
A Multitenant Architecture
In a multitenant architecture, all users share the same infrastructure and the same version of the
Force.com platform. In contrast to their single-tenant counterparts, such as client-server
enterprise applications or email servers, multitenant architectures release upgrades automatically
and simultaneously for all users. Consequently, no one has to worry about buying and
maintaining their own physical stack of hardware and software, or making sure that their
applications always have the latest patch installed.
Besides the Force.com platform, several popular, consumer-based applications also use a
multitenant architecture, including eBay, My Yahoo!, and Google Gmail. Multitenant
architecture allows these applications to be low-cost, quick to deploy, and open to rapid
innovationexactly the qualities for which salesforce.com has also become known.
Figure 3: On-Demand, Multitenant Applications that Run in the Cloud
The platform's multitenant architecture also impacts how developers use the platform to create
new applications. Specifically, it defines a clear boundary between the platform and the
applications that run on it. A boundary is important because it allows applications to define
14
Chapter 1: Introducing the Force.com Platform
their own components without jeopardizing the functionality of the core platform or the data
stored by other users.
A Metadata-Driven Development Model
The Force.com platform uses a metadata-driven development model to help app developers
become more productive in putting together apps. It means that the basic functionality of an
appthat is, the tabs, forms, and linksare defined as metadata in a database rather than
being hard-coded in a programming language. When a user accesses an app through the
Force.com platform, it renders the app's metadata into the interface the user experiences.
As a result of metadata-driven development, the Force.com platform app developers work at
a much higher level of abstraction than if they developed applications using Java or C#, and
are shielded from having to worry about low-level system details that the platform handles
automatically. At the same time, Force.com platform developers can also leverage advanced
features that the platform provides by default.
Customizing your app's metadata might sound intimidating, but as you'll see in this book, the
platform's user interface makes it easy. Anyone who is familiar with using a Web browser can
quickly get up to speed, even if he or she doesn't know any programming languages.
Tip: Developers can use the Force.com Metadata API to programmatically manage
their app's setup. The Force.com Metadata API provides an alternative to the
platform's user interface by allowing developers to directly modify the XML files that
control their organization's metadata. Developers can also use the Metadata API to
migrate configuration changes between organizations, and create their own tools for
managing organization and application metadata. For more information, see Force.com
Metadata API Developer's Guide.
Although at first glance metadata-driven development may seem somewhat esoteric, it's exactly
the same model for how Web browsers work. Instead of hard coding the definition of a Web
page in a free-form programming language, a Web page author first defines the page as HTML,
which is itself a kind of metadata. When a user requests a page, the Web browser renders the
page using the metadata provided in the HTML tags. Even though the HTML/browser
combination does not allow authors as much formatting power as they might get in a regular
publishing tool, it simplifies the work of publishing content to a wide audience and increases
the Web page author's overall productivity.
Likewise, the Force.com platform vastly simplifies the work of building an app and increases
a developer's overall productivity. And, like Web pages that use JavaScript or Flash to add
functionality to HTML pages, the Force.com platform also provides ways for more advanced
developers to add custom functionality to the apps you build.
15
Chapter 1: Introducing the Force.com Platform
APIs
The platform's metadata-driven development model allows app developers to quickly build a
lot of functionality with tools provided by the platform; however, sometimes app developers
want to modify the actual data in an app and use third-party services to create more customized
app behaviors. To do this, they can use a number of APIs to integrate with the platform. The
core set of APIs include Force.com SOAP API and REST API, the Bulk API, Streaming
API, and Metadata API. You can call these APIs from a wide variety of client-side languages
- and toolkits are also available to ease the integration. For more information, see Which API
Should I Use? in the Salesforce Help.
Our APIs provide straightforward, powerful, and open ways to programmatically access the
data and capabilities of any app running on the platform. They allow programmers to access
and manipulate apps from any server location, using any programming language that supports
Web services, like Java, PHP, C#, or .NET. For more information, see
http://wiki.developerforce.com/page/Integration.
Apex
As you might expect from the company that delivered the world's first cloud computing
platform, salesforce.com also introduced the worlds first cloud computing programming
language, Apex. Apex, whose syntax is similar to Java, the most popular programming language
for Web apps, runs on the Force.com platform servers. Apex is specifically designed for building
business applications to manage data and processes within the larger context of the Force.com
platform. The language provides a uniquely powerful and productive approach to creating
functionality and logic, allowing developers to focus just on the elements specific to their
application, while leaving the rest of the plumbing to the Force.com platform.
The majority of this book is intended for readers who don't necessarily code, so Apex is beyond
the scope of what we'll discuss here; however, you can learn everything there is to know at
wiki.developerforce.com/page/Apex.
Visualforce
At the front of any great business application is a great user interface that's easy to use, powerful,
and suited exactly for the tasks, users, and devices the application serves. Visualforce is a
complete framework for creating such user interfaces, enabling any kind of interface design
and interaction to be built and delivered entirely in the cloud. The user interfaces you build
with Visualforce can extend the standard Force.com platform look and feel, or replace it with
16
Chapter 1: Introducing the Force.com Platform
a completely unique style and set of sophisticated interactions. Because Visualforce markup is
ultimately rendered into HTML, designers can use Visualforce tags alongside standard HTML,
JavaScript, Flash, or any other code that can execute within an HTML page on the platform.
And that's only the beginning: you can also use Visualforce pages to combine data from multiple
Force.com platform objects, or blend data from Web services into your applications, as we
discuss in Moving Beyond Point-and-Click App Development on page 333.
Mobile Access
As the primary points of Internet access shift from desktops and laptops to smartphones and
tablets, apps that don't provide mobile access to critical data will quickly become obsolete.
Don't let your app get trampled by the mobile stampede! Instead, use the Salesforce1 app or
Salesforce Classic to deliver your Force.com customizations to your mobile users.
So how do you decide which mobile app to use? Salesforce1 and Salesforce Classic are each
apps themselves. Downloadable versions of these apps install on mobile devices and use the
native functionality of the device. When users log in on a mobile device, they can access and
update their data via an interface specially designed for mobile device screens. Both apps allow
you to work with most standard Sales objects, some standard Service objects, and all custom
objects.
Salesforce1
Administrators dont have to create special configurations for mobile users to access their
organizations data. What users see is controlled by their profile and user permissions,
and the app respects any customizations made in the full Salesforce site. In addition, this
app includes Chatter, so your users can keep collaborating while on the go.
Salesforce1 is supported on Apple
iPhones
and iPads
, as well as Android
phones.
If your organization prohibits installing the downloadable app to corporate-issued devices,
Salesforce1 is also available from a mobile web browser.
Salesforce Classic
Administrators create mobile configurations to determine the Salesforce data, Visualforce
pages, and other elements their mobile uses can access. In addition, Salesforce Classic
stores a subset of data on the device to provide users with offline access when a wireless
connection is unavailable, and synchronizes that data with Force.com when connectivity
is reestablished.
Salesforce Classic is supported on the Apple iPhone and iPod touch
, BlackBerry