SalesforceWizard

Salesforce objects and fields: a beginner tutorial

On this page (8 sections)Lesson 1: Standard and custom objectsLesson 2: Field types and when to use themLesson 3: Relationships: lookup, master-detail and many-to-manyLesson 4: Record types, page layouts and Lightning pagesWhat changed in 2025–26How this is asked in interviewsPractise this topicCommon questions

Everything in Salesforce is stored in objects (like tables) made of fields (like columns), and each record is a row. Understanding objects, fields and relationships is the first step for every admin and developer.

In this topic: Lesson 1: Standard and custom objects · Lesson 2: Field types and when to use them · Lesson 3: Relationships: lookup, master-detail and many-to-many · Lesson 4: Record types, page layouts and Lightning pages

Lesson 1: Standard and custom objects

A standard object comes with Salesforce, such as Account, Contact, Lead, Opportunity and Case. A custom object is one you create for your own business data, such as Invoice or Project. Custom objects end with __c in their API name, for example Invoice__c.

Always check whether a standard object fits first. Standard objects come with built-in features (lead conversion, forecasting, case routing) that you would otherwise have to build yourself.

How to create a custom object

  1. Go to Setup, then Object Manager.
  2. Click Create, then Custom Object.
  3. Enter the label (for example Invoice), plural label and record name (for example Invoice Number, which can be text or an auto number such as INV-{0000}).
  4. Choose options such as Allow Reports and Track Field History, and select Launch New Custom Tab Wizard so users can find the object.
  5. Save, then add fields and a page layout.

Lesson 2: Field types and when to use them

Choosing the right field type keeps data clean and makes reports work. The most common types:

Field typeUse it forExample
Text / Text AreaShort or long free textCustomer reference, notes
Number / Currency / PercentValues you calculate or totalQuantity, Amount, Discount
Date / Date/TimeWhen something happensDue date, meeting time
Picklist / Multi-select picklistA fixed list of choicesStatus, Region
CheckboxYes/no valuesIs Active
Email / Phone / URLContact details, with formatting and validationBilling email
FormulaValues calculated from other fields (read-only)Days open
Roll-Up SummaryTotals from child records (master-detail only)Total invoice amount
Lookup / Master-DetailLinks to another recordInvoice → Account
Tip: Prefer picklists over text when values repeat. They make reports and automation reliable, and a global value set lets several picklists share one list.

Lesson 3: Relationships: lookup, master-detail and many-to-many

LookupMaster-detail
Link is required?No (optional by default)Yes, always
Delete parentChild stays (or delete is blocked, depending on settings)Children are deleted too
Sharing and ownerChild has its own owner and sharingChild follows the parent; no owner field
Roll-up summary fieldsNo (use Flow or code)Yes, on the parent
Limit per objectUp to 40 relationshipsUp to 2 master-detail

A many-to-many relationship uses a junction object: a custom object with two master-detail fields. For example, a Course Enrolment object links Students and Courses, so one student can take many courses and one course has many students.

Other special types: hierarchical relationships (only on User, such as Manager) and external lookups for external objects.

Lesson 4: Record types, page layouts and Lightning pages

Record types let one object support different processes, with different picklist values and page layouts. For example, Opportunity could have New Business and Renewal record types with different stages.

Page layouts control which fields, buttons and related lists users see on a record. Lightning record pages (built in Lightning App Builder) control the overall page design, and Dynamic Forms let you show fields only when they are relevant.

Tip: Before creating a new field, search the object for an existing one. Duplicate and unused fields are one of the most common problems in older orgs.

What changed in 2025–26

  • Dynamic Forms show fields on the record page based on conditions, instead of many page layouts.
  • Relationship limits to remember: 40 relationship fields per object in total, and at most 2 master-detail.
  • Formula and validation work increasingly moves to before-save flows when it needs more than one field or related data.

How this is asked in interviews

  • "Lookup or master-detail?" Master-detail for tightly owned children that need roll-ups and shared security; lookup for loose links.
  • "How do you build a many-to-many relationship?" A junction object with two master-detail fields.
  • "When do you use a record type?" When the same object needs different processes, picklist values or layouts for different groups.
  • See admin interview questions.
How to answer: Start with what you would do, say why, mention the limit or risk you are avoiding, and finish with a real example from a project or practice org. One clear minute beats five minutes of definitions.

Practise this topic

Common questions

01

What is the difference between an object and a record?

An object is the structure, like a table definition (for example Account). A record is one row of data in it (for example the Acme Ltd account).

02

Can I change a lookup to a master-detail relationship?

Yes, but only if every existing child record has a value in the lookup field. Fill the empty ones first, then change the field type.

03

How many custom fields can an object have?

It depends on your edition: Enterprise Edition allows up to 500 custom fields per object and Unlimited up to 800. Check Salesforce's current limits documentation for your org.

Chat on WhatsApp