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
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
- Label: e.g., Desk Reservation
- Plural Label: e.g., Desk Reservations
- Object Name (API Name): Auto-filled, e.g., Desk_Reservation__c
- Choose Record Name field type (Text or Auto Number)
-
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.
- Navigate between related records
- Run joined reports
- Control data visibility and behavior
These relationships allow users to:
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:
- Go to Setup → Object Manager.
- Click on the Child Object (Detail).
- Go to Fields & Relationships → Click New.
- Select Master-Detail Relationship → Click Next.
- Choose the Parent Object (Master) from the list → Click Next.
-
Enter:
- Field Label
- Field Name
- Field-Level Security settings
- Add the field to Page Layouts (optional) → Click Next.
- Define Related List Label (how it appears on the parent record) → Click Next.
- 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.
sanjeet kumar
2025-05-26