Force.com is a object-oriented relational database system. An object is the background of any application built on Force.com. The simplest definition of the object is the database table. It is a container to store data on Force.com and also gives you options to create UI for entering, modifying, or deleting records.
Force.com doesn't give the option to create database tables using code. For creating a table we need to define the object using the UI. With a new custom object we can directly choose to allow activities to the object or we can choose to add notes and attachments to the object. On choosing these options, Force.com automatically creates the UI for adding activities or adding notes.
There are two different types of objects on Force.com:
Let us explore the custom objects in details.
Please refer to the Requirements section to go through the requirement again. The object structure of the Library Management can be summarized in the following table:
Library Management System | ||
---|---|---|
Object name |
Related to (Relationship) |
Comments |
CustomerMedia (Detail object of Media) |
The media object is the master table to store the collection of media. Books and videos are separated by record type to show different types of media. | |
Customer |
CustomerMedia (Detail Object of Customer) Book Penalty (Detail object of Member) |
The Customer object stores the customer information. It also stores the total fine paid by the customer as a roll up field. |
CustomerMedia |
Customer, Media (Master Object) |
The CustomerMedia object stores the customer and media in a junction object and is used during the checkout and check-in function of the Library Management. |
Book Penalty |
Customer |
This is a child object on Customer and stores the amount of late fees paid to the customer. |
For the purpose of the exercise let us create the Customer object. We have to create all the four objects for the Library Management System, so let us start with the Customer object.
The steps for creating a custom object are as follows:
The wizard consists of the following fields:
We have successfully created the Customer object. A custom object has five default standard fields that store system information. We need to create other fields to store different data in the object.
Just like a table in a database an object can have multiple columns, these columns are called fields. Force.com provides some default properties with these fields. Similarly create the other objects for the system.
We are going to look at some major types of custom fields on Force.com. Let us create the fields for the Customer object.