Search Here

Types of relationship

 


 

Types of relationship in Salesforce

You can establish relationships between objects in Salesforce. You can associate one object with another. It called relationship

you have an object named Meetup (to store information about a meeting), and you want to associate it with another object, Participant (to store information about participants for a particular meeting) so that you can associate the Participant records with the respective Meetup record. These relationship types also determine how they handle record sharing, data deletion capability, and required fields in page layouts. Salesforce provides the following types of relationships that can be established among objects:

  • Master-detail relationship
  • Lookup relationship
  • Self-relationship
  • External lookup relationship
  • Indirect lookup relationship
  • Many-to-many relationship (junction object)
  • Hierarchical relationship

Master-detail relationship

It is a strongly coupled relationship among Salesforce objects, which means if a master record gets deleted, then the child records associated with it are also deleted. In this type of relationship, the parent record controls the behavior of the child record regarding visibility and sharing. It means the security setting of a parent object applies to the child object.

For example, if we create a master-detail relationship between the Meetup and Participant objects, where Meetup will act as the parent object and Participant will serve as the child object, then if someone deletes a Meetup record, all the associated Participant records will also get deleted. The following image gives a visual representation of the master-detail relationship between Meetup and Participant

 

Tip

For best practice, don't create more than 10,000 child records for a master-detail relationship.

Lookup relationship

It is a loosely coupled relationship among Salesforce objects, which means even if a parent record gets deleted, the child records remain in the system. Here, both the parent and child have their own sharing settings and security controls. The following image gives a visual representation of the lookup relationship between Meetup and Participant objects and what happen when parent (Meetup) record gets deleted:

Description: https://static.packt-cdn.com/products/9781786463180/graphics/image_01_013.jpg

 

 

For example, if we create a lookup relationship between the Meetup and Participant objects, where Meetup will act as the parent object and Participant will serve as the child object, then if someone deletes a Meetup record, all the associated Participant records will still exist in the system.

Difference between master-detail and lookup relationships

Let's have a look at the differences between the lookup and master-detail relationships in the following table:

Difference between master-detail and lookup relationships

Let's have a look at the differences between the lookup and master-detail relationships in the following table:

Lookup relationship

Master-detail relationship

Loosely coupled.

Strongly coupled.

Roll-up summary field cannot be created.

Roll-up summary field can be created.

Parent record is not required while creating a child record.

Parent record is always required in order to create a child record.

Lookup fields are not required on the page layout of the detail record.

Master-detail field is always required on the page layout of the detail record.

Standard object record can be on the detail side of a custom object in a lookup relationship.

Standard object record cannot be a child.

By default record ownership of child records is not controlled by the parent. 

Parent controls the record ownership of child records. The owner field is not available on the detail record in master-detail relationship queues, sharing rules and manual sharing is not possible for detail records as it requires the owner field.

You can have a child record without a parent.

You cannot have a child record without a parent.

You can have a maximum of 40 lookups on an object.

You can have a maximum of two master details on an object.

No cascade delete.

Cascade delete.

Self-relationship

Self-relationship is another example of a lookup relationship. In Salesforce, we can use lookup relationships to create self-relationship among objects; we can have a maximum of 40 self-lookups. For example, a campaign record can have a Parent Campaign record

External lookup relationship

We can create two special lookups on an external object apart from the standard lookup relationship. They are external lookup relationship and indirect lookup relationship.

External lookup relationship allows us to link an external object to a parent external object whose data is stored in an external data source. In other words, it allows us to link two external objects.

Indirect lookup relationship

An indirect lookup relationship allows us to link an external object to a standard or custom object. We can only create an indirect lookup to an object with a unique external ID field on the parent object that is used to match the records in this relationship. While creating an indirect lookup relationship field on an external object, we have to specify the child object field and the parent object field to match and associate records in the relationship. For example, we can display a related list of payments from the ERP external record with matching external IDs on the account object.

Many-to-many relationship

The many-to-many relationship in Salesforce allows us to link a child record to multiple parents. For example, a campaign is attached to many leads, and one lead may have more than one campaign. A visual representation of the many-to-many relationship is shown in the following image:

Description: https://static.packt-cdn.com/products/9781786463180/graphics/image_01_015.jpg

If you have two objects, called Case and Article, and you want to relate these two objects in such a manner that one case can have multiple articles and one article is linked to many cases, then we have to use the many-to-many relationship. The many-to-many relationship is made with the help of a junction object. In this case, we can create the third object, let's say, Solution with two master-detail relationships with Solution - Case and Solution - Article.

Note

One object can have only two master-detail relationships.

Hierarchical relationship

In Salesforce, only a user object has this type of relationship where we can create a hierarchy of users in the organization. For example, a user can have his manager, and his manager may have senior manager, and so on till the CEO or CIO level. The best example is the manager field on a user object as shown in the following image:

A few points to remember


1.    Use permission sets to enable Lightning Experience for a set of users.

2.    After Summer'16 release, we can have 5 active processes on the Lightning Professional edition.

3.    It is not possible to change standard objects' and fields' API name.

4.    We can add custom fields to standard and custom objects in Salesforce.

5.    We can have a maximum of 40 lookup relationships on an object.

6.    We can have a maximum of two master-detail relationships on an object.

7.    Each Salesforce organization can have up to 100 external objects.

8.    When we delete a custom object, it appears in the Deleted Objects list for 15 days, from where the system administrator can restore it.

9.    Salesforce doesn't allow us to delete a custom field that is used in a roll-up summary field on another object or reference in Apex and Visualforce pages.

10. If a custom object contains more than 100,000 records and you want to delete it, then first delete an appropriate number of records and then delete the object.

11. By default, Lightning Experience is now enabled for all standard profiles.

Test your knowledge


Q1. What types of paid Salesforce editions are available?

1.    Lightning Enterprise Edition

2.    Lightning Unlimited Edition

3.    Lightning Trial Edition

4.    Developer Edition

Q2. What are the two ways to get the record ID?

1.    Dashboard

2.    Report

3.    Data Loader

4.    Validation Rule

Q3. After how many days is a deleted record permanently removed from the recycle bin?

1.    10

2.    15

3.    30

4.    45

Q4. What is the total number of custom fields we can create in a Lightning Enterprise Edition custom object?

1.    300

2.    500

3.    800

4.    Unlimited

Q5. It is possible for a Salesforce object to exist independently of an application.

1.    True

2.    False

Q6. What is the maximum number of master-detail relationships that can be created on a custom object?

1.    10

2.    40

3.    2

4.    8

Q7. An organization wants to leverage a custom object to track sales orders. The organization wants the ability to relate orders to parent orders in a parent-child relationship. What type of relationship should be used?

1.    Master-detail relationship

2.    Self-relationship

3.    Hierarchical relationship

4.    Many-to-many relationship

Chapter 2. Security Settings in Salesforce

This chapter starts with a high-level overview of company profile settings, followed by an overview of role hierarchy, profiles and organization-wide default (OWD) in Salesforce, which will help you to brush up the concepts that you will need as an administrator. We will also discuss permission sets, the various ways for an organization to manage users, and the key concepts related to this management. Later, we will go through how you can troubleshoot common business challenges related to record access and field visibility. All these concepts are very important as these are one time setups that will decide how your Salesforce organization will work in accordance with your organization's structure.

The following topics will be covered in this chapter:

·         Using OWD to secure your organization's data

·         Using the sharing rule to grant record access to users

·         Securing record data using field-level security

·         Managing profiles and permission sets in Salesforce

Company Information setup


In the last chapter, we went through ways of setting up a developer account. Now it's time to move forward to the next step. Company Information contains all basic information about your company, such as local address, fax number and phone numbers.

A business scenario: Universal Containers just brought Salesforce Lightning Unlimited Edition (LUE). Richard Gall has been working as the Salesforce administrator for two years, and he knows how to update the company's basic information, such as the company contact information, the default time zone, and the address.

Just to remind you, once the company has purchased the Salesforce organization, the company has to set up the company profile. Under the heading Setup (gear icon) | Setup | SETTINGS | Company Settings | Company Information, there are various setups available, as shown in the following screenshot:

Description: https://static.packt-cdn.com/products/9781786463180/graphics/image_02_001.jpg

What is salesforce?

Salesforce is a cloud-based customer relationship management (CRM) platform that provides companies with tools and functionalities to manage their customer interactions, sales processes, marketing efforts, and customer service operations. It offers a wide range of integrated applications and services designed to help businesses streamline their operations, improve customer engagement, and drive growth.

Salesforce provides a unified platform where organizations can store and manage customer data, track sales opportunities, automate marketing campaigns, deliver personalized customer service, and collaborate with team members. It allows businesses to have a holistic view of their customers, enabling them to deliver better experiences and build stronger relationships.

Key components and features of Salesforce include:

1.      Sales Cloud: Helps manage sales processes, track leads, opportunities, and customer interactions, and streamline sales forecasting.

2.      Service Cloud: Enables organizations to deliver efficient customer service and support through multiple channels, including email, phone, chat, and social media.

3.      Marketing Cloud: Facilitates marketing automation, email marketing, social media marketing, and personalized customer journeys.

4.      Commerce Cloud: Provides tools for building and managing online e-commerce stores and delivering personalized shopping experiences.

5.      Community Cloud: Allows organizations to create branded online communities for customers, partners, and employees to collaborate, share information, and engage with the company.

6.      Analytics Cloud: Provides powerful data analytics and reporting capabilities to gain insights into sales, marketing, and customer data.

7.      AppExchange: A marketplace where businesses can find and install pre-built applications and integrations to extend the functionality of Salesforce.

Salesforce is highly customizable and can be tailored to meet the specific needs of different industries and businesses of all sizes, from small startups to large enterprises. It is known for its user-friendly interface, scalability, and strong ecosystem of partners and developers that continuously expand its capabilities through customizations and integrations.

Overall, Salesforce empowers organizations to effectively manage customer relationships, drive sales growth, and deliver exceptional customer experiences.

 

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.