Professional Documents
Culture Documents
Junction Object
Data Model is an abstract model, diagrammatic representation of various elements of data involved in a
system. It represents how these elements are related to each other in the real world.
Data Model is designed on paper to clearly represent the system to be created. It involves chalking out its
various elements and how they relate to each other.
User
PK ID
Name
Car
Position_c
PK ID Master-Detail Candidate_c
Job_Application_c
Name
PK ID Master-Detail PK ID
Max Salary Name
Tyres Engine Seats Min Salary Candidate_c Description
Comments Position_c
Master-Detail Master-Detail
Interviewer Review_c
PK ID PK ID
Name Job Application_c
Interview_c
Feedback_c
To create a data model for a Salesforce Application, there are building blocks such as objects, fields, and
Relationships.
DECLARATIVE PROGRAMMATIC
• Applications
• Page Layouts • Visualforce Pages
Finish Order
• Tabs • Lightning Components
• Record Types User Interface
Delivery
create.
Table Table Table
Fields
©Simplilearn. All rights reserved 7
Data Model—Keys
Primary Key is a column which uniquely identifies a row in the table, eg. CustId
A foreign key is a column in a table that uniquely identifies a row of another table.
Customer Contact
First Name Last name CustID CustID ContactInformation Contact Type
Elaine Stevens 101 101 555-2653 Work
Mary Dittman 102 101 555-0057 Cell
Skip Stevenson 103 102 555-8816 Work
Drew Lakeman 104 104 555-0949 Work
Eva Plummer 105 103 555-0650 Work
Standard Objects
Account is a standard object that can be used to store data about other companies you are communicating with.
The developer defines and creates custom objects if data model of the application needs to store data that
is not suitable to be stored in any of the standard objects.
Custom Objects
Fields are similar to columns in an Excel sheet or columns in a table of relational database.
Standard Custom
Fields
Standard fields are available Out Of The Box (OOTB) in Salesforce. As a developer, you don’t need to create
them as these fields have been provided by Salesforce as a part of the standard functionality.
Salesforce ID, also known as ID or Record ID is a standard field which uniquely identifies a record in an object.
The Name field provides a short description of the record to identify it and its contents. This field is required,
but it is not unique. Consequently, two records can have the same value.
The two data type options for the Name field are:
Text Auto-Number
The Owner field refers to a user or a group of users called Queue that will become the owner of the record.
Audits are system assigned read-only fields which are populated after record creation. These fields are called
Audit fields as they provide auditing information about the record.
1 CreatedByID
2 LastModifiedByID
3 CreatedDate
4 LastModifiedDate
The screenshot shows the different types of custom fields created on the Position object and how they
appear on the record layout.
Checkbox field
Dependent picklist field
Currency field
In Salesforce, Relationship fields are created between two objects that need to be associated.
These are usually defined for one-to-one or one-to-many relationships. In the relationship, one
becomes the parent and other the child object.
These fields are created on the child that refer to the parent object. The field stores the associated
parent record ID.
The two types of relationship fields available in Salesforce are Master-Detail and Lookup.
All the scenarios such as one-to-one, one-to-many, and many-to-many relationships are accomplished
using these two types of fields.
Position
Job
Position
Applications
Position__c Job_Application__c
Id Name Id Name Position_c
Child records can be viewed and accessed via the layout of the parent record. The child records show as
“Related Lists”.
Position
Position
Job
Position
Applications
Master-Detail is a relationship between the parent or “master” and the child or “detail” objects.
The characteristics of Master-Detail Relationships are:
• The field created on the detail/child object becomes a required field.
• If the parent record is deleted, then all the child records will also get deleted. This is called Cascade Delete.
• The child record inherits all the permissions, such as sharing and ownership, from the parent record.
Position__c Job_Application__c
Id Name Id Name Position_c
The table outlines the major differences between Master-Detail and Lookup relationship.
A master-detail relationship field needs to be created on the Child Object if a developer needs to create a
roll-up summary field on an object.
Position:
Sr. Developer
To create many-to-many relationships, create a custom object called junction object. Two master-detail
relationship fields need to be created that reference the two objects to be associated. The first master-detail
relationship you create on your junction object becomes the primary relationship. This affects the following
for the junction object records:
Look and feel: The junction object's detail and edit pages use the color and any associated icon of the
primary master object.
Record ownership: The junction object records inherit the value of the Owner field from their associated
primary master record.
Schema Builder is a graphical tool for viewing and modifying objects, their fields, and relationships.
Formulas are smart custom fields that are used to perform calculations relevant to the Business Case. These
fields have a rich set of functions, which are similar to Excel formulas, to perform calculations.
Formula fields have return types available. The result data type of the calculated formula should match the
return type selected for the formula field.
Roll-up Summary Fields or RSF are read-only formula fields that calculate sum, minimum, maximum, or
record count of a field from child records.
Multiple declarative tools, such as validation rules, workflow rules, and process builder are available to
implement business logic.
DECLARATIVE PROGRAMMATIC
• Applications
• Page Layouts • Visualforce
Finish Order
Pages
• Tabs • Lightning Components
• Record Types User Interface
Delivery
Stop
No
Time-dependent workflow actions have time trigger defined for them. The action is queued to fire once the
workflow criteria is met.
Lightning Process Builder is a declarative process automation tool that lets you graphically design business
processes.
Process Builder can perform the following actions, either immediately or scheduled later:
Actions Description
Post to chatter Post a chatter feed to a user, a chatter group, or the record that trigger the process
Update Records Update fields on the record that triggered the process or its related objects
a. Create Tasks
a. Create Tasks
You can send outbound message in a Workflow but not in Process Builder.
You ensure this by creating a Master-Detail relationship field on Job Application to Position Object.
a. Process Builder
b. Schema Builder
c. Workflow Rules
a. Process Builder
b. Schema Builder
c. Workflow Rules
Schema Builder lets you play around with Salesforce Data Model graphically.
a. Validation Rules
a. Validation Rules
Using validation rules, you can ensure that users enter only 16 digits in a credit card number field.
As the lead developer for Universal Containers, you need to design an application for the company to help the
recruiting department to achieve their aggressive recruitment goals in 2017.
You need to design a data model and start creating the necessary elements.
ID Standard field
Name Text, standard field
Max Salary Currency
Min Salary Currency
Comments Text
ID Standard field
Name Text, standard field
Description Text Area
ID Standard field
Name Auto Number (format: JA-{0000})
Standard field
Candidate__c Master-Detail to Candidate object
Position__c Master-Detail to Position object
ID Standard field
Name Text, standard field
ID Standard field
Name Auto Number (format, RW-{00001})
Standard field
Job_Application__c Master-Detail Relationship to Job
Application object
Interviewer__c Lookup Relationship to Interview object
• You can create a data model using objects, fields, and relationships fields.
• You can drive business processes using fields such as formula and roll-up summary fields.
• Schema builder is a graphical tool for viewing and modifying objects, their fields, and
relationships.
• Data entered can be kept in check by creating Validation Rules.
• Workflow Rule is a declarative tool that helps in automating processes in Salesforce.
• Lightning Process Builder is a declarative process automation tool that lets you graphically design
business processes.