Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 36 ยท Objects, Fields and Data Model

Standard and Custom Objects: Building Your Data Model

Learn how objects work in Salesforce: standard versus custom objects, labels and API names, creating a custom object, tabs, Schema Builder and when to build a new object.

Objects are the tables of Salesforce. Deciding which objects you need, and how to name them, is the most important design step an admin takes, because everything else (security, reports, automation) hangs on it. This lesson shows how objects work and walks through creating a custom object.

Standard versus custom

Standard objects come with Salesforce: Account, Contact, Lead, Opportunity, Case, Campaign, Product, Task, Event, User and many others. You cannot delete them, but you can add custom fields, change layouts and rename their labels.

Custom objects are objects you create to store information that standard objects do not cover: Projects, Invoices, Equipment, Courses, Applications. They behave like standard objects (records, fields, layouts, reports, security) and are limited only by your edition.

Labels, API names and the __c suffix

Every object and field has two names:

  • Label: what users see ("Project"). You can change it any time, and it can be translated.
  • API name: what code, formulas and integrations use ("Project__c"). Custom objects, custom fields and custom relationships end with __c. Once other things use the API name, changing it breaks them. Choose it carefully when you create it.

Other special suffixes: __r (a relationship name used to traverse to the parent), __mdt (custom metadata type), __e (platform event), __x (external object) and __History (field history).

Python Stand-in: label to API name

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real rules also forbid two consecutive underscores inside a name and trailing underscores. The helper only illustrates the idea.

Creating a custom object

In Lightning Experience: Setup > Object Manager > Create > Custom Object.

  1. Label (singular) and Plural Label: Project and Projects.
  2. Object Name (API name): defaults to Project, giving Project__c.
  3. Record Name: the name field's label (for example "Project Name") and Data Type: Text (you type names) or Auto Number (Salesforce generates P-{0000}).
  4. Optional features: Allow Reports, Allow Activities, Track Field History, Allow in Chatter Groups, Allow Search, Enable Sharing and others. Turn on only what you need; Allow Reports and Allow Search are usually yes.
  5. Deployment status: In Development (hidden from users, useful while building) or Deployed.
  6. Launch the New Custom Tab Wizard: creates a tab so users can reach the object.
  7. Save, then add fields, layouts and permissions.

After saving, the object does not appear for users until you give a permission set or profile access to it and add its tab to an app. That is a very common stumbling block: "I created the object but nobody sees it."

Creating a custom object does not give anyone access to it, not even you if you are not a System Administrator with "Modify All Data". Always follow the checklist: object, fields, layout, tab, app, permissions.

Object settings worth knowing

  • Track Field History: records old and new values of chosen fields (up to 20 per object) in a related History list.
  • Enable Sharing: lets the object participate in sharing rules and the role hierarchy (Chapter 4). Needed if you want any setting other than public.
  • Allow Activities: lets users log tasks, events and emails.
  • Enable Feeds: Chatter on records.
  • Search: whether records appear in global search.
  • Name field: every object has a Name field that appears in lookups and lists. An Auto Number name helps when no natural name exists.

When to create a new object

Use this checklist:

  1. Is it a thing with its own life cycle, with many instances and its own fields? (Invoice, Project, Course.)
  2. Do you need many of them per parent record? Then a related object beats many fields.
  3. Does it need different security or reports from existing objects?
  4. Is a standard object a close fit? Prefer the standard object (with a record type) over a custom copy, because standard objects come with features: activities, forecasting, standard reports, mobile apps and integrations.

A bad design is adding "Product 1", "Product 2", "Product 3" fields to Account. A good design is a Product Interest object that relates many rows to an account.

Python Stand-in: many fields versus a related object

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The child rows can be filtered, summarized and reported on; fixed columns cannot.

Schema Builder

Schema Builder (Setup > Quick Find > Schema Builder) is a visual canvas for the data model. Drag Object or Field elements from the palette, and see relationships as lines. It is excellent for documenting and discussing a design with colleagues. It shows lookup and master-detail relationships and lets you create fields. Create objects there with care: it uses default settings, and you may need to adjust options afterward.

erDiagram
    ACCOUNT ||--o{ PROJECT : "has"
    PROJECT ||--o{ TASK_ITEM : "contains"
    CONTACT ||--o{ PROJECT : "sponsors"

A small data model: an account has many projects, a project has many task items, a contact can sponsor projects.

Deleting and renaming objects

Deleting a custom object moves it to the Deleted Objects list for 15 days and removes its data from view; things that reference it (flows, formulas, reports) can break first, so Salesforce blocks deletion while dependencies exist. You can restore from Deleted Objects before it is erased permanently. Renaming a label is safe; renaming an API name is not.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What suffix do custom objects and fields have in their API names?

    __c marks custom objects and fields. __r marks relationship names, __x external objects, __e platform events.
  2. 2. You created a custom object but nobody can see its tab. What is the most likely missing step?

    Objects are invisible until users have permissions and the tab is available in an app.
  3. 3. When is a custom object a better choice than extra fields on Account?

    A related object stores many rows per parent, which fixed fields on the parent cannot do cleanly.
  4. 4. What is the safest thing to change after other components reference an object?

    Labels are cosmetic. API names are used in formulas, flows, code and integrations.

Summary

  • Standard objects ship with Salesforce; custom objects model your own business entities and end with __c.
  • Labels can change freely; API names should stay stable.
  • Creating an object is only the first step: add fields, layouts, a tab, an app and permissions.
  • Prefer related objects to repeating fields, and prefer standard objects when they fit.

Next: Field Types and Picklists