Custom Blog Image

Difference between Setup and Non-Setup Objects in Salesforce

Setup and Non-Setup Objects in Salesforce

When working in Salesforce, you’ll often come across the terms setup objects and non-setup objects. Whether you’re building automation or writing SOQL queries, knowing which type of object you’re dealing with can save you from errors and confusion.

In simple terms, setup objects store metadata and configuration details, while non-setup objects hold the actual business data your company works with every day. Understanding this distinction helps both admins and developers design better solutions and avoid common pitfalls.

What are Setup Objects?

Setup objects are the objects in Salesforce that hold configuration and metadata information about your org. They define how your Salesforce environment is structured and controlled.

For instance, if a new employee joins your company, you create a User for them, assign a Profile to define their access, and maybe apply a Permission Set to give extra rights.

All of these are setup objects because they help configure how this user interacts with Salesforce, not the actual data they’ll work on.

Example:

  • User – Stores details about people who can log in.
  • Profile – Controls what users can see and do.
  • PermissionSet – Grants additional access beyond profiles.
  • ApexClass – Contains code written by developers.

Key Characteristics of Setup Objects:

  • They define org configuration, security and code.
  • They are tightly tied to administration and governance.
  • They are not about customer records but about who can use Salesforce and how it’s set up.
  • Accessing or modifying them usually requires administrative privileges.

 

Setup Objects in Salesforce

What are Non-Setup Objects?

Non-setup objects in Salesforce hold the real business data your organization uses every day. These include things like accounts, contacts, leads, cases, and opportunities. They’re the records your teams rely on to manage operations, track progress, and serve customers effectively.

Common Examples of Non-Setup Objects:

  • Account – Stores company/customer information
  • Contact – Holds data about individual people
  • Opportunity – Tracks potential deals
  • Case – Used for customer service and support tracking

Key Characteristics of Non-Setup Objects:

  • They hold transactional or business-specific data
  • Created and used by end users (Sales, Support, Marketing, etc.)
  • Can be queried, reported on, and visualized in dashboards
  • Governed by record-level access and sharing settings
  • Frequently used in automation, reports, and integrations

Non-Setup Objects in Salesforce

Key Differences Between Setup and Non-Setup Objects in Salesforce

Setup Objects Non-Setup Objects
Definition Store configuration, metadata, and org-level settings Store actual business or transactional data
Examples User, Profile, PermissionSet, ApexClass Account, Contact, Opportunity, Case
Used By Admins and Developers End users (Sales, Support, Marketing)
Data Type Metadata & access configuration Business records & operational data
Security Controlled via administrative permissions Controlled via sharing rules, roles, and OWD
Querying Limitation Cannot be directly joined with a non-setup in the same SOQL Can be joined with other non-setup objects
Common Usage Assigning permissions, managing users, and deploying code Managing customer relationships, sales, and service cases

Tip : You cannot perform a single SOQL query that joins setup and non-setup objects. This is a common mistake that leads to runtime errors.

Workarounds & Best Practices for Setup and Non-Setup Objects

When working with setup and non-setup objects in Salesforce, you’ll often face limitations, especially when querying or automating across both types. Here are some tried-and-true workarounds and best practices to keep your solutions clean and error-free.

1. Use Separate SOQL Queries

Instead of trying to join setup and non-setup objects in one query (which Salesforce doesn’t allow), write separate SOQL queries and stitch the data together in Apex.

2. Use Custom Metadata/Settings to Bridge Logic

When your logic requires setup object conditions (such as profile names), consider storing these values in Custom Metadata Types or Custom Settings, which are easier to reference in automation and Apex.

3. In Flows or Integrations, Use Get Records Wisely

If you are building Flows:

  • Don’t try to fetch User.Profile.Name directly from a non-setup record.
  • Use a Get Records for setup object separately and store that value in a variable.

4. Avoid Hardcoding Profile or PermissionSet IDs

These are setup objects and vary by environment. Instead, query by Name or use Custom Metadata to store values safely.

Looking to learn Salesforce Flow? Check out the complete Salesforce Flow Mastery Course here

FAQs

1. Can I query setup and non-setup objects together in a single SOQL statement?

No. Salesforce doesn’t allow joining setup and non-setup objects in the same SOQL query. You’ll need to use separate queries and merge the data in Apex.

2. How do I know if an object is a setup object or not?

A simple rule: if the object deals with configuration, permissions, users, or metadata, it’s likely a setup object. If it stores business data like customers, deals, or cases, it’s a non-setup object.

3. Is the User object a setup or non-setup object?

Although it feels like business data, the User object is a setup object because it stores login access and is managed from the Setup menu.

4. Why does my query fail when accessing related fields like User.Profile.Name from Account?

That’s because you’re trying to join a non-setup object (Account) with a setup object (Profile via User). Salesforce blocks this type of cross-object SOQL query.

5. Which objects should I use in Flows and which in Setup?

Use non-setup objects in Flows for things like Account, Contact, and Opportunity. Use setup objects for automation triggers only when necessary (like updating a PermissionSetAssignment), and always check for access permissions.

Conclusion

Understanding the difference between setup and non-setup objects in Salesforce is essential for anyone building, automating, or securing solutions on the platform. While setup objects define how your org is structured, like users, profiles, and permissions, non-setup objects capture the actual business data your teams work with every day.

By knowing which type of object you’re dealing with, you can avoid SOQL limitations, build smarter Flows, and write error-free Apex code. Whether you’re a Salesforce admin or developer, this knowledge will help you design more scalable and secure solutions that work seamlessly across environments.

Get a complete Roadmap To Learn Salesforce Admin and Development 👇

Share Now

Leave a Reply

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