Sub topic 1
What a Salesforce Org Is
Prerequisites
This chapter assumes you have:
- A basic idea of what Salesforce is: a cloud CRM (customer relationship management) and application platform.
- A modern web browser and an email address you can access. You need both from the next chapters onward.
- Some comfort reading terminal commands. This chapter shows only one small code sample, and you don't need to run it yet.
You don't need an account yet. This chapter builds the mental model that the later sign-up steps rely on.
The working definition
An org (short for organization) is one customer's private environment inside Salesforce. It holds four things:
- Data: records such as accounts, contacts, and your own custom objects.
- Metadata: the configuration that describes how the org behaves. This includes object and field definitions, page layouts, flows, and permission sets.
- Code: Apex classes, triggers, and Lightning web components. These are stored as metadata too.
- Users: the people, and integrations, who can sign in.
Everything in an org belongs to that org alone. Another org can have an account called "Acme" with different fields, different users, and different automation, and neither org can see the other.
When people say "my Salesforce," they usually mean one org. A company often has several, such as a production org, test orgs, and orgs from acquired companies. A developer who is learning will have several as well. This tutorial gets you your first one.
Multitenancy: why an org is not a server
You don't get a database or a virtual machine when you sign up. Salesforce is multitenant, which means many customers (tenants) share the same hardware, the same application code, and the same databases. Each tenant's rows are tagged with that tenant's org ID, and the platform filters every query by it.
This design explains several things you will meet later:
- Metadata drives the platform. When you create a custom field, Salesforce records a metadata entry. It doesn't alter a physical table. The runtime reads that metadata to decide what to show and what to store.
- Governor limits exist. One tenant must not starve the others, so the platform caps things like the number of SOQL queries or the CPU time in one transaction.
- Upgrades arrive for everyone. Salesforce releases three times a year, and your org is upgraded on the platform's schedule.
An instance is a group of servers that hosts many orgs, for example NA123 or CS45. Your org lives on one instance, but the instance is not your org. A common mistake is to treat the two as the same thing. The My Domain URL, which a later chapter covers, hides the instance name for you.
How an org is identified
An org has several identifiers. Learners often mix them up, so keep them apart.
| Identifier | Example | What it is for |
|---|---|---|
| Org ID | `00D5g000001AbCdEAK` | A unique 15 or 18 character ID. Every org ID starts with `00D`. Support cases and tools use it. |
| Org name | `Acme Dev` | A label you can change. It isn't unique. |
| Username | `[email protected]` | The login name of one user. It is unique across all of Salesforce. |
| My Domain URL | `https://acme-dev-ed.my.salesforce.com` | The web address for your org. |
| Alias (CLI) | `my-dev-org` | A nickname the Salesforce CLI stores on your computer. Salesforce doesn't know it. |
The username row matters most for the sign-up. Usernames look like email addresses, but they don't have to be real ones, and no two users in any org can share one. The next chapters cover the exact rules and what to do when your first choice is taken.
You can read your own org ID from anonymous Apex once you have an org:
System.debug('Org ID: ' + UserInfo.getOrganizationId());
System.debug('Org name: ' + UserInfo.getOrganizationName());Run this in the Developer Console (Debug, then Open Execute Anonymous Apex). You'll find the output in the debug log. If the first line shows a value starting with 00D, you are looking at an org ID.
Production and non-production orgs
Orgs fall into two broad groups.
- Production orgs hold real business data for real users. Customers pay for them, and they are what "live" means in Salesforce.
- Non-production orgs exist for learning, building, and testing. They don't hold live customer data, or shouldn't.
The next chapter compares the non-production types in detail. Here is the short version:
- A Developer Edition org is a free, standalone org for learning and building. It is not connected to any other org. This is what you will create.
- A Trailhead Playground is a similar free org that Trailhead provides for completing its modules.
- A sandbox is a copy of a production org, made for testing changes before release.
- A scratch org is a temporary, configurable org created from source files with the Salesforce CLI. It needs a Dev Hub org to create it.
Each of these is a separate org with its own org ID. A sandbox is not "part of" production. It is a different org that was created from production's metadata and, depending on the sandbox type, some of its data. Changes you make in one do not appear in the other unless you deploy them.
Editions, features, and why they matter
An org has an edition, which is a package of features and limits. Examples include Enterprise Edition, Unlimited Edition, and Developer Edition. The edition determines which features the org has, how much storage it gets, and how many API calls it can make.
Developer Edition gives you most of the platform features that Enterprise Edition has, such as Apex, Lightning components, and the APIs, but it has much smaller data and file limits. That makes it a good place to learn, and a poor place to run a business. A later chapter lists the limits. You can see the edition from the command line with this query, which the final chapters use to confirm the org:
sf data query --target-org my-dev-org --query "SELECT Name, OrganizationType FROM Organization"The Organization object has exactly one record in every org, and it describes that org. This is a good example of the idea of an org: even the description of the org is stored as data inside it.
Common misunderstandings
These are the mistakes learners make most often at this stage.
- Treating all your orgs as one account. Your email address may be the contact for several orgs, but each org has its own username, password, users, and data. Signing in to one doesn't sign you in to another.
- Expecting changes to travel between orgs. Creating a field in your Developer Edition org does nothing to your employer's sandbox. Moving changes between orgs is a deliberate step called deployment.
- Confusing the org name with the username. The org name is a label. The username is what you type at login.
- Assuming a Developer Edition org is a trial. A trial org expires after a fixed period. A Developer Edition org doesn't, but it can be deactivated if you stop logging in. A later chapter explains how to keep it active.
- Using a Developer Edition org for real customer data. The limits are small, and the org is not meant to be a supported production system. Treat it as a workspace for learning and building.
- Mixing up an instance with an org. A support article that says "your org is on NA123" means the instance. Other orgs on NA123 are not yours.
What this means for the next steps
Because every org is separate, the sign-up process creates a brand new org with a new first user. You are both the owner and the administrator of it. That is why you will have to pick a username that is unique across all of Salesforce, verify your email, set a password, and register multi-factor authentication. Nobody has done any of this for you in advance.
It also means you can create more than one Developer Edition org later, for example one for experiments and one for a project. Each needs its own unique username, though the same email address can be used for the contact.
Exercise
A teammate says, "I added a custom field called Region__c in my Developer Edition org, so it should now exist in our company's production org." What is wrong with this statement, and what two org properties explain it?
Show answer
Each org has its own metadata, so a custom field created in one org exists only in that org. A Developer Edition org is standalone and not connected to production. The field would reach production only through a deliberate deployment. The two properties are separate metadata per org and separate org IDs, which make the orgs independent environments.
Exercise
Which of these values is guaranteed to be unique across all of Salesforce: the org name, the username, or the alias in the Salesforce CLI? Which of them does Salesforce not know about at all?
Show answer
The username is unique across all of Salesforce. The org name is only a label and can be shared. The CLI alias is stored on your own computer, so Salesforce does not know about it.
Exercise
An org ID begins with which three characters, and which tool in this chapter shows it?
Show answer
An org ID begins with 00D. Anonymous Apex that calls UserInfo.getOrganizationId() prints it to the debug log.