What is an Object in Salesforce?

Blog
Spread the love

In Salesforce, an object is like a table in a database. It stores data in a structured way. Each object contains:

  • Fields (like table columns)
  • Records (like rows of data)

These objects help you organize and relate information across your CRM system.

Types of Objects in Salesforce

1. Standard Objects

These are pre-built objects provided by Salesforce. You don’t need to create them—they’re already available and cover common business entities.

Object Name Purpose
Account Company or organization info
Contact People related to accounts
Opportunity Tracking on sales deals or revenue opportunities
Lead Potential customer
Case Customer service/support request
User Info about people using Salesforce

2. Custom Objects

These are objects you create to meet your organization’s unique requirements.

Tip: A custom object’s API name always ends with __c.

Examples:

  • Maintenance_Request__c
  • Invoice__c
  • Project__c

Steps to Create a Custom Object in Salesforce

Step 1: Go to Setup

  • Click the gear icon (⚙️) at the top right.
  • Select “Setup”.

Step 2: Open Object Manager

  • In the Quick Find box, type “Object Manager”.
  • Click on “Object Manager” from the search results.

Step 3: Create the Custom Object

  • Click the “Create” dropdown.
  • Select “Custom Object”.

Step 4: Fill in Object Details

  1. Label: e.g., Desk Reservation
  2. Plural Label: e.g., Desk Reservations
  3. Object Name (API Name): Auto-filled, e.g., Desk_Reservation__c
  4. Choose Record Name field type (Text or Auto Number)
  5. Check the options you need:

    • “Allow Reports”
    • “Allow Activities”
    • “Track Field History”
    • “Allow in Chatter Groups”
    • “Launch New Custom Tab Wizard” (recommended)

Step 5: Save the Object

Step 6 (Optional): Create a Tab

  • If you enabled the Tab Wizard, Salesforce would help you create a custom tab so you can access your new object directly from the App Launcher.

Perfect! Now that we’ve covered what an object is and how to create one, it’s time to understand how objects relate to each other in Salesforce.

Object Relationship

What is an Object Relationship in Salesforce?

An object relationship in Salesforce defines how two objects are connected to each other. Just like foreign keys in a relational database, relationships help link records from one object to records in another.

For example:

  • An Account can have many related Contacts.
  • A Project__c can have multiple related Tasks__c.
    • These relationships allow users to:

    • Navigate between related records
    • Run joined reports
    • Control data visibility and behavior

Types of Object Relationships in Salesforce

Lookup Relationship

A Lookup Relationship is a one-to-one relationship that links one object to another in a non-dependent way. It is used when:

The child record can exist without the parent record.

You want to reuse common data (like a list of Countries, Departments, etc.).

There’s no need for cascading deletes (unlike Master-Detail).

Key Characteristics:

Optional Relationship: Child can exist without a related parent.

Separate Ownership: Parent and child records have separate owners.

No Cascade Delete by Default: Deleting the parent doesn’t delete the child.

Cross-Object Field Access: You can reference fields from the parent in formulas, reports, etc.

Example: Office__c has a lookup field to Country__c

This means each Office can be associated with one Country.But a Country can exist with or without Offices.

Steps to Create a Lookup Relationship Field

1. Go to Setup

Click the gear icon in the top right, then select Setup.

2. Navigate to Object Manager

From the Setup menu, type Object Manager in the Quick Find box.

Select the object where you want to create the lookup field (e.g., Office__c).

3. Create a New Field

Go to Fields & Relationships.

Click New.

4. Choose Field Type

Select Lookup Relationship and click Next.

5. Choose the Related Object

Choose the object you want to look up to (e.g., Country__c) and click Next.

6. Field Details

Enter the Field Label (e.g., “Country”).

Field Name will be auto generated (you can customize it if needed).

7. Field-Level Security

Choose visibility for profiles as required and click Next.

8. Page Layouts

Choose which layouts should include this field and click Next.

9. Add Related List (Optional)

Add a related list on the parent object’s page layout, if applicable.

10. Save

Click Save to create the lookup relationship

Master-Detail Relationship

Master-Detail Relationship in Salesforce is a type of relationship between two objects where one object (the Detail/Child) is tightly linked to another object (the Master/Parent). Here’s a brief overview:

  • Dependency:

    The child record depends on the parent. if the parent is deleted, the child is also deleted automatically (cascading delete).

  • Ownership and Sharing:

    The child record inherits the owner’s permissions and sharing rules from the parent.

  • Roll-Up Summary Fields:
    Only available in Master-Detail relationships, allowing calculations like SUM, MIN, MAX, and COUNT from child records on the parent record.
  • Required Relationship:
    A detail record must always have a master; you can’t save a child record without linking it to a parent.

Steps to Create a Master-Detail Relationship:

  1. Go to Setup → Object Manager.
  2. Click on the Child Object (Detail).
  3. Go to Fields & Relationships → Click New.
  4. Select Master-Detail Relationship → Click Next.
  5. Choose the Parent Object (Master) from the list → Click Next.
  6. Enter:

    1. Field Label
    2. Field Name
  7. Field-Level Security settings
  8. Add the field to Page Layouts (optional) → Click Next.
  9. Define Related List Label (how it appears on the parent record) → Click Next.
  10. Click Save.

🔒 Notes:

  • The child object must not have any existing records, otherwise Salesforce won’t allow creating the Master-Detail field.
  • A custom object can only have two master-detail fields.
  • If you later want to convert it to a Lookup, you must remove Roll-Up Summary fields first.
Avatar

sanjeet kumar

2025-05-26

0

Leave a Reply

Your email address will not be published. Required fields are marked *

Find More Blogs

What is an Object in Salesforce?

Spread the love In Salesforce, an object is like a table in

Asynchronous Apex in Salesforce: A Simple Guide

Spread the love In Salesforce development, managing how and

Understanding Database Allows Callout in Salesforce Apex

Spread the love In Salesforce, the Database.AllowsCallouts

PODMAN

Spread the love 1.Introduction Podman: The Modern Container

Running Your Java Program (JAR) 24/7 on AWS EC2 Automatically

Spread the love Introduction Running a Java application

Building a REST API with Spring Boot

Spread the love Introduction REST (Representational State

Custom API to Fetch Customer Data by Customer ID in Spryker

Spread the love Introduction In this blog post, we will

Creating a Custom Module for a Custom Frontend Page in Spryker

Spread the love To create a custom module for a custom

How to create custom module api get category list without access token in Spryker

Spread the love To create a custom API for fetching a

Creating a Custom Glue API in Spryker

Spread the love Spryker’s Glue API is a powerful tool

bluethinkinc Blogs