HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
Foreword by Craig Weissman, CTO, Salesforce.com
Build Cloud-Based Enterprise Applications Fast–and Drive More Value at Lower Cost!
Using the Force.com platform, enterprise developers can build and deploy powerful applications far more rapidly than traditional J2EE, Microsoft .NET, or LAMP technology stacks permit. With a free subscription to the Force.com platform, developers can build apps that solve virtually any enterprise challenge with remarkable value, scalability, and reliability.
This is the first book that brings together all the practical, technical guidance you need to make the most of Force.com in your own custom enterprise applications. Leading Force.com developer Jason Ouellette helps you identify suitable uses for Force.com and provides all the insights and sample code needed to rapidly prototype, deploy, and integrate with production-quality Force.com applications.
Ouellette provides realistic code examples at every step, emphasizing maintainability, flexibility, and
interoperability throughout. Writing for developers, architects, and analysts, he shows how to
• Create custom enterprise apps on Force.com in days or weeks, not months or years
• Leverage Force.com’s extensive capabilities for storing, managing, and securing data
• Quickly create sophisticated business logic with the Apex programming language
• Use Visualforce to construct custom user interfaces
• Establish automated or semiautomated workflows
• Implement Ajax behaviors without writing JavaScript code or learning new JavaScript libraries
• Integrate Force.com-based data and processes with other applications, inside and outside the platform
• Display reports as state-of-the-art dashboards
• Integrate Force.com applications with existing Single Sign-On systems
This book’s extensive sample code may be downloaded from Force.com AppExchange at http://sites.force.com/appexchange/listingDetail?listingId=a0N30000001SS3rEAG
For content updates, see author Jason Ouellette's blog at jasonouellette.com. If you are a force.com member, you can also download the sample application and code here: http://sites.force.com/appexchange/listingDetail?listingId=a0N30000001SS3rEAG
Introducing Force.com: Building Business Applications in the Cloud
Download the sample pages (includes Chapter 1 and Index)
Foreword xvi
Preface xix
Acknowledgments xxi
About the Author xxii
Chapter 1 Introducing Force.com 1
Force.com in the Cloud Computing Landscape 1
Platform as a Service (PaaS) 2
Force.com as a Platform 4
Force.com Services 7
Inside a Force.com Project 9
Project Selection 9
Team Selection 11
Lifecycle 12
Tools and Resources 15
Sample Application: Services Manager 17
Background 17
User Roles 18
Development Plan 18
Summary 19
Chapter 2 Database Essentials 21
Overview of Force.com’s Database 21
Objects 21
Fields 23
Relationships 25
Query Language 25
Data Integration 28
Working with Custom Objects 31
Force.com Developer Edition 31
Tools for Custom Objects 31
Object Creation 33
Field Creation 36
Entering and Browsing Data 38
Sample Application: Data Model 41
Logical Data Model 41
Force.com Data Model 47
Implementing the Data Model 50
Importing Data 55
Summary 60
Chapter 3 Database Security 63
Overview of Database Security 63
Object-Level Security 65
Profiles 66
Field-Level Security 67
Record-Level Security 69
Record Ownership 69
User Groups 70
Sharing Model 70
Sample Application: Securing Data 73
Designing the Security Model 74
Implementing the Security Model 78
Testing the Security Model 83
Summary 88
Chapter 4 Additional Database Features 89
Dependent Fields 90
Record Types 90
Defining Record Types 91
Securing Record Types 92
Using Record Types 93
Roll-Up Summary Fields 95
Field History Tracking 97
Tags 98
Enabling Tags 99
Using Tags 99
Force.com Connect Offline 100
Administration of Force.com Connect Offline 100
Using Force.com Connect Offline 102
Sample Application: Applying the Features 103
Dependent Fields for Skill Types 104
Roll-Up Summary Fields for Project Reporting 104
Force.com Connect Offline for Staffing 107
Summary 109
Chapter 5 Business Logic 111
Introduction to Apex 112
Introducing the Force.com IDE 113
Installation 113
Force.com Perspective 113
Force.com Projects 114
Problems View 115
Schema Explorer 115
Apex Test Runner View 116
Execute Anonymous View 116
Apex Language Basics 116
Variables 117
Operators 121
Arrays and Collections 122
Control Logic 124
Understanding Governor Limits 129
Database Integration in Apex 130
Database Records as Objects 130
Database Queries 132
Persisting Database Records 137
Database Triggers 139
Database Security in Apex 142
Object-Oriented Apex 143
Encapsulation 143
Information Hiding 147
Modularity 148
Inheritance 149
Polymorphism 150
Debugging and Testing 151
Debugging 151
Testing 154
Sample Application: Validating Timecards 155
Force.com IDE Setup 156
Creating the Trigger 156
Unit Testing 157
Summary 159
Chapter 6 Advanced Business Logic 161
Additional SOQL Features 161
Inner Join and Outer Join 162
Semi-Join and Anti-Join 163
Multi-Select Picklists 166
Salesforce Object Search Language (SOSL) 167
SOSL Basics 167
SOSL in Apex 168
Transaction Processing 170
Data Manipulation Language (DML) Database Methods 170
Savepoints 171
Record Locking 173
Apex Managed Sharing 174
Sharing Objects 175
Creating Sharing Rules in Apex 176
Sending and Receiving Email 180
Sending Email 181
Receiving Email 185
Dynamic Apex 187
Dynamic Database Queries 188
Schema Metadata 189
Sample Application: Adding Email Notifications 192
Summary 193
Chapter 7 User Interfaces 195
Introduction to Visualforce 196
Overview of Visualforce 196
Getting Started with Visualforce 198
Visualforce Controllers 201
Standard Controllers 201
Custom Controllers 203
Controller Extensions 206
View Components 207
View Component Basics 208
Data Components 210
Action Components 213
Primitive Components 214
Force.com-Styled Components 215
Force.com User Interface Components 218
Visualforce and the Native User Interface 222
Standard Pages 222
Standard Buttons 224
Page Layouts 225
Custom Buttons and Links 226
Custom Tabs 227
Visualforce in Production 227
Security 228
Error Handling 230
Governor Limits 232
Unit Tests 232
Sample Application: Skills Matrix 233
Basic Implementation 234
Full Implementation 235
Implementation Walkthrough 236
Summary 242
Chapter 8 Advanced User Interfaces 245
Asynchronous Actions 245
Partial Page Refresh 246
Action as JavaScript Function 247
Action as Timed Event 248
Action as JavaScript Event 249
Indicating Action Status 250
Modular Visualforce 252
Static Resources 252
Inclusion 253
Composition 253
Custom Visualforce Components 255
Extending Visualforce 257
Using JavaScript Libraries 257
Adobe Flex and Visualforce 258
Force.com Sites 264
Sample Application: Enhanced Skills Matrix 268
Summary 272
Chapter 9 Integration 273
Force.com Integration Solutions 273
Outbound Messaging 274
Salesforce-to-Salesforce (S2S) 279
Developing Custom Integrations 288
Calling Web Services from Apex Code 289
Using HTTP Integration 290
Sample Application: Anonymous Benchmarking 293
Visualforce Page Design 294
Visualforce Controller Design 295
Integrating the Web Service 296
Sample Implementation 299
Summary 302
Chapter 10 Advanced Integration 303
Understanding Force.com Web Services 304
Basics of Force.com Web Services 304
Generating the Web Service Client 306
Logging In 310
Force.com Data Types in SOAP 313
Error Handling 314
Using the Enterprise API 314
Retrieving Records 315
Writing Records 317
Building Custom Web Services in Apex 319
Understanding Custom Web Services 320
Service Definition 321
Calling a Custom Web Service 322
Introduction to the Metadata API 323
Overview 323
Getting Started with the Metadata API 324
Sample Application: Database Integration 326
Integration Scenario 326
Implementation Strategy 326
Sample Implementation 327
Summary 330
Chapter 11 Additional Platform Features 333
Workflow and Approvals 333
Introduction to Workflow 334
Getting Started with Approval Processes 335
Introduction to Analytics 342
Working with Reports 343
Configuring Dashboards 345
Using Analytic Snapshots 346
Force.com for International Organizations 347
Multilingual Support 348
Using Multiple Currencies 350
Advanced Currency Management (ACM) 353
Using Single Sign-On 354
Federated Single Sign-On 354
Delegated Single Sign-On 359
Sample Application: Project Map Dashboard 362
Summary 368
Index 369