Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Force.com Application Development
Learning Force.com Application Development

Learning Force.com Application Development: Use the Force.com platform to design and develop real-world, cutting-edge cloud applications

By Chamil Madusanka
€39.99 €27.98
Book Apr 2015 406 pages 1st Edition
eBook
€39.99 €27.98
Print
€48.99
Subscription
€14.99 Monthly
eBook
€39.99 €27.98
Print
€48.99
Subscription
€14.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Apr 27, 2015
Length 406 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781782172796
Vendor :
Salesforce
Category :
Languages :
Table of content icon View table of contents Preview book icon Preview Book

Learning Force.com Application Development

Chapter 1. Getting Started with Force.com

Cloud computing has made significant changes to the IT/software development industry. Cloud platforms are one of the important components of cloud computing. Cloud platforms allow developers to develop apps and run them on the Cloud, including platforms to build on-demand applications and platforms as a service (PaaS). Salesforce.com has introduced the first on-demand platform called Force.com.

This chapter introduces the Force.com platform and explains designing and developing applications on the Force.com platform. The sample application scenario and Entity Relationship Diagram (ERD) will be introduced at the end of this chapter. This chapter covers the following topics:

  • Introduction to the Force.com platform

  • Designing and developing applications on the Force.com platform

  • Identifying building blocks of the Force.com platform

  • The sample application

Introduction to the Force.com platform


Salesforce.com established the company as a Customer Relationship Management (CRM) product vender in 1999. The Force.com platform, which is known as Salesforce.com's platform as a service (PaaS) product, was launched in 2007. Force.com is a cloud computing platform that allows for developers to quickly build, share, and run custom business applications over the Internet. When we are developing applications on the Force.com platform, we don't need any additional hardware, additional software, and configuration and maintenance (database and hardware) efforts. The Force.com platform provides three default application categories, which include applications of Salesforce.com CRM. The main categories are as follows;

  • Sales cloud: This is for the automated Sales processes of an organization. For example, from campaign management to lead capture and account to quote management, you can do everything related to Sales here. Sales cloud can be used for marketing, leads, opportunities, and maintaining new customers (Accounts and Contacts).

  • Service cloud: This is used for any kind of support application such as call center, customer support desk, and so on. It helps the organization to manage their support on the cloud.

  • Chatter: This is the collaboration tool of Salesforce CRM. It helps the organization to integrate back office work in to Salesforce.

The Force.com platform runs on Salesforce.com's infrastructures with the main architecture called multitenant architecture. For more details about multitenancy, read the Key features of Force.com platform subsection. The multitenant architecture allows us to build custom applications without purchasing hardware and software licenses and without having to worry about database maintenance. It provides a trusted, configurable and customizable, upgradable, able to integrate, and a secure platform to build our custom applications on.

Understanding the Force.com model

In traditional software development, we need to manage additional software and hardware, software licenses, networks, database configurations, and maintenance by ourselves. However, the Force.com platform provides these additional features in their cloud computing model. We need to pay only for the things we use, not for all the hardware and software. That's because we get the Force.com platform as a service.

The architecture of the Force.com platform

The preceding figure shows the overview of the Force.com platform. The following table shows you the difference between the traditional platform and the Force.com platform.

Traditional Platform

Force.com Platform

Supply the core services of Database access

Form builder (build complete and standard UIs)

Supply Containers for logic

Process builder

Supply Containers for presentation

Logic and presentation as a service (Apex and Visualforce for custom developments)

Need to use other software to create our app

Fully functional reporting and analytical tools

Additional components to run the data center

Security

All of this will end up with additional expenditure

Sharing model

 

Workflow and approvals

 

Full support for the integrations with existing systems

 

Full support for mobile devices

 

Can access the platform through a web browser

Key features of the Force.com platform

The following are the key features of the Force.com platform:

  • Multitenancy

  • Application services

  • Force.com metadata

  • MVC architecture

  • Programming language

  • Integration

  • Force.com sites

  • AppExchange

Multitenancy

Multitenancy is the major technology of the Force.com cloud platform. It is used to share the IT resources in a secure and cost-effective way. Let's consider a real-world example to understand the multitenancy. Let's think about a luxury apartment complex with some facilities such as a playground, a swimming pool, and a gymnasium. This apartment complex has multiple owners. Everyone owns a separate apartment and every owner uses the shared playground, the shared swimming pool, and the shared gymnasium. These facilities are equal to a single, shared stack of hardware and software. The apartment is equal to the instance of a single client (a tenant). Therefore, a client has their own apartment with shared facilities and privacy.

The multitenant architecture

There are some advantages of multitenancy, which are as follows:

  • User satisfaction

  • Cost reduction

  • Automatic upgrades

  • No maintenance

  • Enhanced quality

  • User retention

  • Application providers can reach the hosted application

  • Application providers can gather some information (such as errors and performance issues) of the application, which will be helpful to make further enhancements

  • An error can be incurred from a particular tenant, but the solutions will be received by all the users who use the application

Application services

In traditional software development projects, we have to build or integrate various additional support applications such as login, validations, e-mail functions, reporting, UI, testing, and integrations. You had to repeatedly build these kinds of additional support applications in different projects. The Force.com platform provides the majority of support applications, which are most commonly needed in developing today's business application. For example, the Force.com platform has various features to automate your business process such as reporting, workflow and approvals, e-mail, user authentication, and integrations. These services are common to many software projects. Therefore, we can build applications with more functionality and within a short time period.

Force.com metadata

With multitenancy, we get secure, fast, reliable, customizable, and upgradable applications. When it comes to custom extensions by multiple tenants, we need to track and keep tenant-specific customizations without affecting the core application. The metadata-driven architecture takes care of that. After multitenancy, metadata-driven architecture is the second most important architecture in the Force.com platform. All the configuration, customization, and coding in the Force.com platform are defined and available as XML. It can be extracted and imported via a set of web services. Simply, metadata is data about data. The metadata-driven model provides the following advantages:

  • Complex applications can be created by only using point-click developments (without any coding).

  • A developer can build the application with the end user experience but the elements of the application are automatically translated to the metadata at creation time.

  • Metadata provides a speedy development.

  • Customization and extensions can be done without affecting the end user.

  • Metadata can be used to construct an identical environment to use in another organization.

  • Metadata can be used to assist version controlling.

  • Metadata can be used for testing and troubleshooting by comparing multiple environments.

    The metadata architecture of Force.com

The preceding figure shows the metadata-driven architecture of Force.com. It creates the separation between the runtime engine, the application data, and metadata. The polymorphic application includes database tables, relationships, UI elements, pages, classes, and so on.

MVC architecture

The Force.com platform uses the Model View Controller (MVC) architectural pattern for developing an application:

  • Model: This defines the structure of the data. In Force.com, objects define the data model. Salesforce has designed the platform by mapping every entity to some object.

  • View: This defines how the data is represented. In Force.com, page layouts and Visualforce pages come under this category.

  • Controller: This defines the business logic. The rules and actions which manipulate the data control the view. In Force.com, apex classes, triggers, workflows, approvals, and validation rules are under this category.

Programming language

The Force.com platform provides its own set of programming language, mark-up language, query language, and search language.

Apex

Apex, the world's first on-demand language is considered as the programming language of the Force.com platform. Apex is object oriented and the syntax is similar to Java and C#. It allows developers to build the logic with the interaction of existing platform features. According to the MVC architecture, Apex falls into the controller because it is used to write the controller classes and triggers on the Force.com platform. Apex can be used to:

  • Create custom controllers/Controller extensions

  • Create triggers that are executed automatically in records such as insert, update, delete and undelete particular objects

  • Access and invoke external web services

  • Create batch jobs

Visualforce

Visualforce is an implementation of MVC architecture. In the Force.com platform, we can develop Force.com applications with custom objects and standard objects. Every object has a standard user interface with one or more page layouts. But we cannot use standard page layouts for complex requirements. Here, Visualforce comes into play.

Visualforce is a web-based user interface framework, which can be used to build complex, attractive, and dynamic custom UIs. Visualforce allows the developer to use standard web development technologies such as jQuery, JavaScript, CSS, and HTML5. Therefore, we can build rich UIs for any app, including mobile apps. We'll be discussing Visualforce with standard web development technologies and Visualforce for mobile in more depth later. Similar to HTML, the Visualforce framework includes a tag-based markup language.

SOQL

Salesforce Object Query Language (SOQL) allows us to fetch data from Saleforce objects. SOQL syntax is similar to SQL but simpler. For example, SOQL has the SELECT keyword but doesn't contain the INSERT or UPDATE keywords. It is different from SQL as SOQL doesn't have the JOIN keyword. SOQL can be used in Apex code and it provides a powerful feature to manipulate and process data in Apex code.

Tip

Salesforce objects are similar to database tables. This will be explained in the next couple of chapters.

SOSL

Salesforce Object Search Language (SOSL) allows us to search your organization's data from Salesforce objects by specifying a text expression, scope of field to search, list of objects and fields to retrieve, and conditions to select rows in the source objects.

Tip

SOQL is used to fetch data from a single object and SOSL is used to fetch data from multiple objects. More about SOSL and SOQL will be discussed in Chapter 7, Custom Coding with Apex.

Integration

The Force.com platform provides the facility to integrate with existing applications. There are various advantages of integrating, such as including external systems into our processes, syncing data from multiple sources, and accessing data in other systems. Using an open Simple Object Access Protocol (SOAP) web service, the Force.com API provides access to all the data stored in the application. There are integration benefits as follows:

  • By using Force.com technologies, it takes less time to integrate than traditional integrations

  • The Force.com platform-based API provides direct and low-level access to Salesforce application data and metadata

  • There are many options to choose integration technologies and solutions that fit into their existing system

  • Proven platform and integration

Force.com sites

Force.com sites allow us to create public sites using Salesforce.com data, Visualforce, and standard web technologies such as CSS, JavaScript, and jQuery. Force.com sites are directly integrated with the Salesforce organization and it doesn't require a user authentication using the Salesforce username and password. A Force.com site has the following features and benefits:

  • Data from selected organizations can be exposed to the public through your own domain URL

  • There are no integration issues because Force.com sites are hosted on Salesforce servers

  • It can be built using Visualforce pages

  • According to the requirement, you can enable or disable the user registration

AppExchange

With the preceding features, you can build different kinds of applications. But how can you publish and distribute these applications? AppExchange will do it for you. AppExchange is the place to submit your developed applications, which can be directly installed in the client's organization.

AppExchange—the destination for CRM and Force.com apps

Advantages of Force.com

When we use Force.com platform to build enterprise applications instead of traditional software development, we will gain the following advantages:

  • We don't need to buy, install, maintain, and configure hardware and software.

  • We can start customizations as soon as we buy the organization and user license.

  • We can rapidly build and customize the applications on the Force.com platform.

  • The Force.com platform has a simplified development model because it uses multitenant and metadata-driven architecture.

  • It has the feature of instant scalability.

  • Quarterly upgrades of Salesforce.com do not require any maintenance from the user.

  • We can use or build multiple applications on a single platform. This is dependent on which Salesforce edition you are using. In Salesforce, the limitations change from edition to edition.

  • This is a proven platform for business-critical applications.

  • The Force.com platform is more secure and reliable. To learn more about security and trust visit http://trust.salesforce.com/.

Designing and developing applications on the Force.com platform


Before you start development on the Force.com platform, you have to do some ground work and have to learn about the data orientation of the Force.com platform, suitability of the application for the Force.com platform, the nature of the data underlying that application, and design the application for the Force.com application.

Signing up for a free developer edition account

The Force.com platform provides the development environments, tools, resources, and documentation, which can be used to develop applications. The Force.com tools will be described in Appendix A, Force.com tools. When we talk about development environments, free developer edition (DE) environment is the best option to develop with the latest technologies such as the Apex programming language, Visualforce markup language, and web services API.

Tip

DE is free, and you can use it for learning purposes, although it comes with certain limitations.

Follow the steps to create a free developer account:

  1. Go to https://developer.salesforce.com/.

  2. Click on Signup.

    The developerforce web page

  3. Then, you will get the following page and fill all the fields in the form.

    The registration page

    Tip

    Select a unique username in the form of an e-mail by which you will access your developer edition account. Salesforce allows you to select a unique name by default. If you select any pre-existing username, you will get an error.

  4. Click on Sign me up.

  5. An e-mail will be received including the link to specify your login credentials

Basic application design

When we design and build an application on the Force.com platform, we need to be aware of the data that we are going to process underneath the application. Good data design and good development practices can produce flexible and efficient applications.

Types of applications suitable for Force.com

We cannot use the Force.com platform for any kind of application development. Therefore, we need to understand the apps that are better suited for the Force.com platform. There are four types of applications that are required to automate an enterprise process, which are as follows:

  • Data-Centric Apps: Data-centric applications are the ones that have powerful databases. They are based on the structure and consistency data such as in database or XML files. They are centered on a database and with data-centric apps it is easy to control access and manage data, which are centered to the database. The Force.com platform is data-centric by its nature and it is a perfect platform to build and host data-centric apps.

  • Process-Centric Apps: A process-centric app is based on automating the business process in the organization and multiple users can be involved in the process. The Force.com platform has many features that align with the features of process-centric applications such as the approval process, the workflow, and security and sharing models.

  • Content-Centric Apps: These applications are intensely increasing the storage needs of on-demand performance. These kinds of applications have main functionalities such as version controlling, content management, and sharing.

  • Transaction-Centric Apps: The main functions of these types of applications are focused on transactions such as banking systems, stock market-related systems, and online payment systems.

Data and process-centric apps are the most suitable application types for the Force.com platform. The following two figures explain to us how the data-centric and process-centric apps are the most suitable apps for the Force.com platform:

Types of apps that are a good fit for the Force.com platform

Types of apps suitable for the Force.com platform

Design consideration

When we develop a system on the Force.com platform, we need to consider some facts about the design phase. As in traditional software development, identifying your stakeholders and business partners is the first thing you need to do. Then, you need to capture the business requirement from your stakeholders. By analyzing the captured requirement, you can identify the users of the applications and the security model of the application. The security model is the most important part of designing a Force.com application.

Tip

Do not keep the defining of the security model of the Force.com application to the end. It will only increase the rework required of the application's designing and development.

Customization on the Force.com platform

In the design phase, we can consider the development method, which can be used to develop the particular application. There are two development methods on the Force.com platform. They are as follows:

  1. Declarative Development: This development can be done using point and click with zero coding. We can do declarative development via the browser. The declarative customizations require an understanding of the Force.com platform overview, but no coding knowledge. The developments and deployments can be rapidly done using the declarative development method.

  2. Programmatic Development: Programmatic developments require coding skills and allow developments to extend beyond the declarative capabilities. For example, if we need to create a page with a wizard, we cannot fulfill that requirement with declarative development. We need to use programmatic development, such as Apex and Visualforce.

The following screenshot shows the Force.com development model. It illustrates the deviation development methods with the skills of the developer.

Force.com development model

Most complete and robust solutions actually use a combination of declarative and programmatic solutions. Developers should understand how to develop using both declarative and programmatic features. The following table shows the advantages of declarative and programmatic customizations:

Declarative customizations

Programmatic customizations

Ease of development (more visual and quicker to do)

Can extend the capabilities of an application beyond standard functionalities

Ease of upgrade

More control and flexibility over the application

Ease of maintenance

 

Identifying building blocks of the Force.com platform


Every application has some key components that are considered as the building blocks of the particular application. These building blocks define the application. An application of the Force.com platform also has three core components, which are as follows:

  1. Objects: The object is the main component of building the application on the Force.com platform. The Force.com platform doesn't allow accessing the database of a particular application. But we can create an object instead of a database table. Therefore, an object and object field will be respectively mapped to a database table and table columns of the particular table. There are two types of objects: standard objects and custom objects. Standard objects are used in CRM applications and they are created by Salesforce.com. The custom objects are created by developers according to their requirements. This book is focused on Force.com development. Therefore, you will work more with custom objects, and according to the requirements, you will work with standard objects. For further details, refer to Chapter 2, Building the Data Model.

  2. Tabs: These are the views of objects. We need to declare tabs if we want to insert data records in them. There are standard tabs that are created by Salesforce.com and custom tabs that can be created by developers. There are 3 types of custom tabs:

    1. Custom object tabs: On Force.com, when we create a custom object, a set of user interfaces are generated to add, edit, and view particular object records. These standard user interfaces can be bound to a custom object tab. While creating an object, it is asked at the bottom to launch the tab wizard, opening of which redirects us to the next page where we declare the tab of an object.

    2. Custom web tabs: These types of tabs are used to display external web applications or a web page in the Salesforce platform.

    3. Visualforce tabs: These types of tabs are used to bind and display a Visualforce page. More details about custom tabs will be described in Chapter 3, Building the User Interface.

  3. Application: An application is a group of tabs that work as a unit to provide functionality. A Saleforce.com organization can have multiple applications. The users can switch between apps in an organization. Then we need to have a method to define the logical boundary of the app. The number of custom applications in a particular organization depends on the Salesforce edition of the organization.

More details about the custom app will be described in Chapter 3, Building the User Interface.

The sample application


Let's introduce the leave management application called eLeaveForce. In this application, an employee can request a particular type of leave and his/her manager can approve the leave. We will maintain the leave types and leave categories as reference data (user defined data). A holiday calendar will be maintained for this leave management application. You can use this application to learn about different elements and features of the Force.com platform.

The following is the E-R diagram of the eLeaveForce application, which we will create on the Force.com platform:

E-R diagram of eLeaveForce

In this section, you will capture an idea about the leave management application and the design of the eLeaveForce application. Later, you will learn about the Force.com platform in depth by using this sample application.

There are six custom objects for our leave management application. These six custom objects are used to track the data of the leave management app. They are as follows:

  • Employee

  • Holiday Calendar

  • Leave (main leave object)

  • Leave Type

  • Leave Category

  • Leave Configuration

According to the requirement, these objects are connected with relationships as illustrated in the E-R diagram. More details about custom objects and relationships will be described in Chapter 2, Building the Data Model.

When we define the security model of the application, we need to consider the built-in security features of the Force.com platform. More details about sharing and security models will be described in Chapter 4, Designing Apps for Multiple Users and Protecting Data.

Our leave management app has a few approval processes, such as getting the approval for the particular leave. Approval processes are considered in our design and will be implemented using the in-built workflow and approval processes. More details about workflow and approval processes will be described in Chapter 5, Implementing Business Processes.

We will use Visualforce pages and Apex to accomplish the requirements that can be fulfilled beyond the declarative developments. For example, a graphical view of the current status of the leave process will be displayed on a Visualforce page. More details about Apex and Visualforce will be described in Chapter 7, Custom Coding with Apex and Chapter 8, Building Custom Pages with Visualforce.

Summary


In this chapter, we became familiar with the Force.com platform by examining its key features and advantages. You have learned the design considerations of an application on the Force.com platform and development methods of the Force.com platform. We discussed the building blocks of a Force.com application. We also captured the scenario and the E-R diagram of the sample application, which is going to continue in the next chapter.

Left arrow icon Right arrow icon

Key benefits

What you will learn

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Apr 27, 2015
Length 406 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781782172796
Vendor :
Salesforce
Category :
Languages :

Table of Contents

21 Chapters
Learning Force.com Application Development Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
Acknowledgments Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Getting Started with Force.com Chevron down icon Chevron up icon
Building the Data Model Chevron down icon Chevron up icon
Building the User Interface Chevron down icon Chevron up icon
Designing Apps for Multiple Users and Protecting Data Chevron down icon Chevron up icon
Implementing Business Processes Chevron down icon Chevron up icon
Data Management on the Force.com Platform Chevron down icon Chevron up icon
Custom Coding with Apex Chevron down icon Chevron up icon
Building Custom Pages with Visualforce Chevron down icon Chevron up icon
Analytics as a Service with the Force.com Platform Chevron down icon Chevron up icon
E-mail Services with the Force.com Platform Chevron down icon Chevron up icon
Building Public Websites with Force.com Sites Chevron down icon Chevron up icon
Deploying the Force.com Application Chevron down icon Chevron up icon
Force.com Tools Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.