Have you ever wondered how Salesforce manages to accomplish so much in very little time? Well, the secret lies in its architecture and object relationships. Now, let us check how Object Architecture and Relationships in Salesforce work wonders. The thought is to impart to the technology enthusiasts some understanding about how Salesforce does what it does.
Salesforce Objects
A database is a collection of structured information modelled in rows and columns in a series of tables to make processing and data querying efficient. If you’re not familiar with databases, think about storing data in a spreadsheet.
Unlike relational databases that store data in rows and columns, the Salesforce Platform uses objects to store data with tables as objects, columns as fields, and rows as records.
Objects, in a nutshell, are containers for your information, with additional enhancements that make them more powerful. For example, when you create a custom object, the platform automatically builds things like the page layout for the user interface.
Objects:
There are two types of objects:
Standard Objects: These are objects included with Salesforce, and access will be dependent on the type of license you purchase, for example,
- Sales Cloud License: Accounts, Leads, Opportunity, Campaigns, Quotes, etc.
- Service Cloud License: Accounts, Cases, Knowledge, Entitlements, etc.
They are represented using standard object API names like Account, Contact.
Custom Objects: You create new objects to capture information specific to your business processes and requirements. They are represented using __c annotation like Test_Drive__c.
Fields
Fields in Salesforce are a representation of columns in relational databases. It can store different types of data values as per the business requirement.
Similar to objects, there are two types of fields:
Standard Fields: Each standard object comes with a standard set of prebuilt fields. There are limited customization options with standard fields, and users cannot delete them from the system.
Custom Fields: Every business has a unique set of requirements and data points to track information. You can create custom fields on standard or custom objects. A user can use custom fields to capture the information that is not covered by standard fields.
Here are some of the key takeaways on the fields.
Object Relationships
An object relationship is a two-way association between two objects established using custom relationship fields on the objects. This is used when users want to access records, along with related data. For Example, Auto Car is an automobile company that sells cars through dealerships. Users can view all the test drive records (child) from the customer account record (parent).
Looking through the most used four types of relationships in Salesforce:
Lookup Relationship: A loosely coupled relationship essentially links two objects together to “lookup” one object from the related items on another object.
Master-Detail Relationship: It is a strongly coupled relationship. In this type of relationship, one object is the master, and another is the detail. The master object controls certain behaviours of the detail object, like who can view the detail’s data.
Below are the key differences between the two important and most used relationships:
Many-to-Many Relationships: Also known as Junction Objects, this relationship allows each record of a single object to be linked to multiple records of other objects and vice versa. They are created using a custom object and then relating two other objects via two master-detail relationships.
Hierarchical Relationships: This unique relationship can only be used on the user object and is designed to create a hierarchy of users. For example, it could be used to create a lookup field for the user object, which can be used to list the user’s expense approver.
Summary
Objects Architecture and Relationships are a core part of Salesforce data modelling. Hopefully, this article gave you a good understanding of the objects, fields, and relationships and how to use them in your implementation.
Are you interested to learn further about Salesforce and its features? Click on Salesforce Certification Programs and Sign Up on saasguru.co and upgrade your career to the next level.