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 questionsEverything 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
- Go to Setup, then Object Manager.
- Click Create, then Custom Object.
- 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}).
- Choose options such as Allow Reports and Track Field History, and select Launch New Custom Tab Wizard so users can find the object.
- 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 type | Use it for | Example |
|---|---|---|
| Text / Text Area | Short or long free text | Customer reference, notes |
| Number / Currency / Percent | Values you calculate or total | Quantity, Amount, Discount |
| Date / Date/Time | When something happens | Due date, meeting time |
| Picklist / Multi-select picklist | A fixed list of choices | Status, Region |
| Checkbox | Yes/no values | Is Active |
| Email / Phone / URL | Contact details, with formatting and validation | Billing email |
| Formula | Values calculated from other fields (read-only) | Days open |
| Roll-Up Summary | Totals from child records (master-detail only) | Total invoice amount |
| Lookup / Master-Detail | Links to another record | Invoice → 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
| Lookup | Master-detail | |
|---|---|---|
| Link is required? | No (optional by default) | Yes, always |
| Delete parent | Child stays (or delete is blocked, depending on settings) | Children are deleted too |
| Sharing and owner | Child has its own owner and sharing | Child follows the parent; no owner field |
| Roll-up summary fields | No (use Flow or code) | Yes, on the parent |
| Limit per object | Up to 40 relationships | Up 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
- Custom fields and objects practice exercises, with model answers
- Salesforce admin interview questions
- Interview questions for freshers
- Admin mock interview
Common questions
01What is the difference between an object and a record?
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).
02Can I change a lookup to a master-detail relationship?
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.
03How many custom fields can an object have?
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.