Book Image

Force.com Tips and Tricks

By : Ankit Arora, Abhinav Gupta
Book Image

Force.com Tips and Tricks

By: Ankit Arora, Abhinav Gupta

Overview of this book

<p>Force.com is an extremely powerful, scalable and secure cloud platform, delivering a complete technology stack covering the ground from database and security to workflow and user interface.</p> <p>Force.com Tips and Tricks starts with very basic admin tasks and gradually moves to hard-core coding tips and tricks for the multitenant Force.com platform.</p> <p>The book starts with the basics of Cloud Computing and Principles and constructs of Force.com. The book then swiftly move to detailed coverage of Salesforce analytics.</p> <p>The book also shows how to set up development environments and and gives detailed understanding of tools and destinations that every Force.com developer should know. The book also covers important administration concepts where you gain vital information for key topics such as schema and reporting for an organization. For Force.com, troubleshooting a problem and code reuse are two important aspects that help in boosting productivity, a complete chapter is dedicated to these tasks.</p> <p>This book takes you beyond any documentation or course and promises hands-on expertise.</p>
Table of Contents (15 chapters)
Force.com Tips and Tricks
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Force.com is an interesting platform, which allows us to do many things by using the declarative or point-and-click model; without writing a single line of code. This book takes you beyond any documentation or course, and promises hands-on expertise.

Force.com Tips and Tricks will quickly groom you for various Force.com platform secrets that can normally be learnt only after years of exposure. This book is your key to the authors' vast experience with the platform.

Force.com Tips and Tricks starts with very basic admin tasks and gradually moves to hardcore coding tips and tricks for the multitenant Force.com platform.

You will learn admin concepts and basics where you will gain tips and tricks for key topics such as schema and accurate reporting for an organization. Troubleshooting a problem and code re-use are two important aspects that help in boosting productivity; a complete chapter is dedicated to these tasks. As the Force.com platform is multitenant in nature, it requires a more mature mindset compared to other programming languages; expert tips on developing this skill are covered in detail.

What this book covers

Chapter 1, Learning to Fly with Force.com, covers the basics of cloud computing. This chapter discusses the principles and constructs of Force.com, the benefits and building blocks of Force.com, when to choose this platform, and many more topics.

Chapter 2, Admin Tools, delves deeper into the Force.com platform. This chapter will discuss topics such as Data Loader, the Import wizard, AppExchange marketplace, and Integrated Development Environment.

Chapter 3, Making Best Use of Salesforce Objects, discusses different field data types in Salesforce, various considerations for defining relationships between objects, key standard objects (for CRM), and so on.

Chapter 4, Understanding Analytics, explains about the Salesforce analytics. Salesforce.com provides a very comprehensive analytics and reporting system, which can be used to organize, view, and analyze your data so as to provide real-time visibility into the business.

Chapter 5, Setting Up Development Environments, discusses various development and test environments, and their usages in different scenarios. This chapter will provide tips on how to choose an appropriate development environment.

Chapter 6, Tools and Destinations that Every Force.com Developer Should Know, introduces various tools such as Schema Explorers, toolkits, and data migrators, and destinations such as Twitter, Cookbook, and the DeveloperForce wiki.

Chapter 7, Writing Better Apex Code, illustrates some key best practices, tips, and tricks to write better code in Apex and maintain a good relationship with the governor, that is, as a good tenant.

Chapter 8, Writing Better Visualforce Code, covers tips and tricks around key Visualforce areas such as differentiating facts about Visualforce architecture, how to re-use the native look and feel in pages, and limiting the view state.

What you need for this book

Here is the list of software that you may require for implementing the examples discussed in this book:

  • Stable version of a good A grade browser (latest version would be best) supported by Salesforce, such as Chrome, Firefox, or Internet Explorer

  • Salesforce Developer Edition Org—one you can sign up for an account at http://www.developerforce.com/events/regular/registration.php?d=70130000000EjHb

  • Eclipse for desktop installation or an in-browser Developer Console should be fine

  • Salesforce DataLoader and Microsoft Excel for Data Loader related tasks

Who this book is for

Force.com Tips and Tricks is not a bible or a complete reference for the Force.com platform development. The time-saving tips and tricks make this book handy for novices as well as experienced developers. This is basically for Force.com developers, who want to extend their Force.com applications, using Flex, Apex, and Visualforce.

When to adopt cloud computing

For an organization, shifting the delivery model from traditional on-premise development to the cloud is a great strategic step, and there are some key considerations to it. Services offered by the cloud vendors may not be suitable for a particular enterprise as the size of an organization is one of the major deciding factors. An organization may need a service when it is in the initial stages, but may need to drop it as it grows.

Consider the following points when deciding on adopting the cloud delivery model:

  • The cloud is built to scale its services on demand. Assess whether your demand is stable or changes widely. If it's more or less stable, you may not need to go for extensive cloud services, otherwise the cloud is for you.

  • Is the usage frequency of cloud services high? If yes, you may not need to opt for the cloud's "pay-as-you-go" model.

  • If your application is mission critical, and needs very strict SLAs (service-level agreements) and almost full control over the infrastructure, you may need to reconsider going for the cloud.

  • Are you a start up? If yes, you may not need to invest upfront heavily in infrastructure. the cloud's "pay-as-you-go" model fits easily here.

  • Does your organization have a preferred technology and development platform? If yes, vendor lock-in may be a potential issue as migrating from one cloud service provider to another would be much more painstaking than doing it in-house with on-premise software.

  • How do you want show your expenses in the balance sheet? Cloud computing model related expenses are being treated as operational expenses and not capital expenses!

When to adopt Force.com for your project

If you have decided to go with the cloud computing way, you may want to consider the option of using Force.com for your projects. We have listed some key guidelines based on the features that the platform has to offer, to help you decide whether Force.com is the right choice for you or not.

  • Is your application data centric with storage and retrieval of structured data? This is the core capability of the platform, and applications that are focused on structured data are best suited for this platform.

  • Is your application going to store and work with high data volume? Do you have any data warehousing requirements or complex analytics? Force.com may not be the right choice in this case as it's a simple transactional database, limited to only a few million records per object/table.

  • Does your application involve large binary content files, such as audio/video, and other heavy marketing material content? The data size is costly on Force.com, so you may either consider another platform or work in conjunction with other cloud services such as Amazon S3 servers.

  • Is your application built around designing configurable dynamic page layouts, wizards, reports, dashboards? Force.com is for you then.

  • Does your application address a complex business problem involving many workflows and approvals? Do you want non-technical people to manage and maintain applications with the point and click operations? Force.com is the right choice here.

  • Do you need fine-grained security and sharing settings on your data? Do you want to provide hierarchical data access to your users based on the organizational roles? Custom solutions take a lot of time to build this capability, which is natively offered by the platform through the point and click operations.

  • Will your application talk to other applications? Is there any third-party integration needed? Force.com has native robust and extensive support for web services integration, both inbound and outbound.

  • Does your application involve e-mails, discussions, and collaborations with Twitter-like functionalities? Features such as e-mail services and chatter are presented as native offerings, thus making Force.com the right choice.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Within the build.xml file, there are named targets that process a series of commands when you run Ant with a target name."

A block of code is set as follows:

IF(
AND(Payment_Due_Date__c < TODAY(),
ISPICKVAL(Payment_Status__c, "UNPAID")),
"PAYMENT OVERDUE",
null )

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public with sharing class AccountExtension {
  public Account[] init() {
    // Apart from matching criteria, only those accounts visible to 
    current user will be returned
    return [Select Id, Name from Account Where Name like '%corp'];
 }
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "If your object name is not displayed, click on Show all objects."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.