This book provides over 100 "recipes" for writing s-controls, using the Force.com API, developing Apex scripts, and creating Visualforce pages.
This wide ranging volume covers topics such as Getting Started, Developing On-Demand Apps, Best Practices for Writing S-Controls, Best Practices for Writing Apex, Searching and Querying Data, Improving Data Quality, Customizing Buttons and Links, Customizing Salesforce Pages and Fields, Integrating with Other Services, Writing Web Controls and Client Applications, Debugging S-Controls and Apex, Packaging an App for the AppExchange, and Getting Started with Visualforce. These highly practical code “recipes” provide expert methods, patterns, and solutions for building and improving on demand apps.
A great prerequisite to the Cookbook is Creating On-Demand Applications: An Introduction to the Force.com Platform (free), an ideal book for individuals who want to learn about the native capabilities of the Force.com platform.
Find a Few Excerpts from the Force.com Cookbook
Welcome to the Force.com Platform
The technology that makes building on-demand applications so easy is called Force.com — the world's first on-demand platform for building, sharing, and running business applications. Force.com is unique among development platforms for the following reasons:
Force.com runs in a hosted, multitenant environment. That means you can access any app you build on the platform from anywhere in the world with just an Internet connection and a Web browser. No servers or databases need to be maintained, and no software needs to be installed or upgraded. Instead, Salesforce.com provides a hosted environment in which the latest features and functionality are seamlessly available to all users with every new release. And you'll have the peace of mind of knowing that any app you were using or building before the new release will work just as well after the release too, regardless of whether it was a standard CRM app from Salesforce.com or a custom app you developed on your own.
As a developer, the platform's multitenant architecture also means that you never have to worry about scaling your apps from one to one thousand or even to one million users — all of the infrastructure to handle such growth is provided free of charge, automatically behind the scenes. That leaves you more time to focus on your business problems and solutions, rather than spending time trying to anticipate the pressures that increased usage might exert on your apps.
Any app written on the platform has access to a built-in community of potential customers on the AppExchange. Unlike traditional software, where you have to create an install wizard and send your code to a manufacturer to cut hundreds of CDs, you can easily share and distribute your app on the AppExchange directory with only a few clicks of the mouse. You can quickly share your apps privately with just the people you want, or you can publish your apps for anyone to download. If you do publish an app publicly, the community of users on the AppExchange can take your app for a test drive and review comments from other users about how well it worked. Additionally, information about the users who end up downloading your app is sent directly to you in the form of a new lead in any Salesforce organization that you specify.
When you're ready to release new versions of your app, the AppExchange also helps you communicate and manage the upgrade process for all of your users. You can track which of your customers is on which version of your app, and you never have to worry that your users have broken or deleted any component your app relies on.
Force.com comes with a wide variety of built-in, point-and-click functionalities that can help you build your apps faster. Need a way to store data in your app? Define new database objects, fields, and relationships declaratively with the mouse, rather than by composing SQL CREATE statements. Need to control which users have access to different kinds of data? Again, no coding necessary — just use the security and sharing framework to define permissions at different levels of granularity, from individual fields to entire objects and applications. Force.com includes point-and-click tools for everything from string localization to workflow rules and approval processes, from custom reports and dashboards to page layouts and data import wizards. This means you can spend less time recreating the "plumbing" that makes your applications run and more time on the unique functionality that sets your apps apart from your competitor's. And what happens when you want to go beyond the capabilities of the point-and-click tools the platform provides? The Force.com Web Services API, Apex, and Visualforce give you the flexibility you need to build the applications you want. Integrate third-party Web services with embedded mash-ups, change the logic behind every function with Apex classes and triggers, and redesign the user interface the way you want with Visualforce. You're limited only by your imagination!
The Sample Recruiting App
Some of the recipes in this book require a custom app for illustration. In these cases, this book uses the custom Recruiting app that was developed as part of Creating On-Demand Applications: An Introduction to the Force.com Platform. The schema for this Recruiting app is pictured in the following entity-relationship diagram and can be downloaded here.
Chapter 1: Getting Started
Like other development platforms you're familiar with, the Force.com platform includes the free tools you'll need to make development easier — a free Salesforce organization in which to do your development, Salesforce.com-certified documentation and training, an IDE, toolkits, and more. Whether you prefer to develop your on-demand applications on a Windows-based platform or the Mac OS X platform, there are development tools you can use to boost your productivity and make your job a lot easier.
In this chapter...
- Signing Up for a Free Developer Edition Account
- Finding Documentation
- Finding Training Courses
- Deciding What to Build
- Installing AJAX Tools
- Installing Force.com Explorer (for Windows)
- Installing SoqlXplorer (for Mac OS X)
- Installing the Flex Toolkit for Force.com
Chapter 2: Developing On-Demand Apps
Now that you've got your development tools all set up, you're ready to start developing. But wait! What's the best way to develop the different components of your app? What's the difference between s-controls, Web controls, Apex, and Visualforce? And how do you know which Salesforce edition is right for your app?
In this chapter...
- Targeting a Salesforce Edition
- Deciding When to Use S-Controls, Client Apps, Apex, or Visualforce
- Building and Deploying an App
- Creating a Sandbox
- Migrating Metadata Between Two Organizations
- Migrating Apex Between Two Salesforce Organizations