How to Find Salesforce Org ID

Salesforce is an American company started in San Francisco, California USA. It has been more than two decades, and over 150,00 (Hundred fifty thousand) popular companies are building their business using salesforce.

In this salesforce tutorial, we will learn how to find salesforce org ID. Also, we will cover these topics:

  • How to find salesforce org id
  • How to get salesforce org id using developer console
  • How to find your salesforce org id
  • How to find 18 digit org id in salesforce
  • How to find salesforce instance id
  • How to find sandbox org id in salesforce
  • How to find salesforce id for an account

If you are new to salesforce, check out, How to get a free salesforce account.

How to find salesforce org id

Salesforce org id is a unique identifier for the salesforce account and this id is used while opening a new case with the support team or for requesting new access.

Suppose you work at XYZ Pvt Ltd, San Francisco, USA, and the organization uses Salesforce CRM. You have been promoted to a higher level of management and now you need access on advance tools.

While requesting access you need to provide the salesforce org id to the support team or the admin so that they can identify the salesforce account and can grant you access.

Step 1: On the salesforce, lightning dashboard click on the gear icon at the top right corner.

how to find salesforce org id,
How to find salesforce id,
How to find out salesforce id
How to find salesforce org id

Step 2: On the Quick Find search for Company Information and there under the organization details you will see 15 character salesforce.com Organization ID.

how to find salesforce org id
Salesforce org ID

With this, we have learned how to find salesforce org id in salesforce lightning.

Read How to Access Developer Console in Salesforce

How to get salesforce org id using developer console

In this previous section, we have learned how to find salesforce org id in salesforce from the salesforce lightning dashboard. In this section, we will learn how to get salesforce org id through the developer console.

Option 1: Start Developer Console -> Debug -> Open Execute Anonymous Window. Now type the below code to get salesforce org id.

system.debug(UserInfo.getOrganizationId());
How to get salesforce org id
get salesforce org id
How to get salesforce organization id, 
how to find your salesforce org id
How to get salesforce organization id

Option 2: Start Developer console -> Query Editor, Now type the below query to get the salesforce org id in salesforce.

Please note: Do not put the semicolon (;) at the end of the script otherwise the script will throw the following error – Unknown error parsing query.

SELECT Id, Name FROM ORGANIZATION
How to find salesforce organization id
Find salesforce id using the query editor

This is how to get salesforce org id.

Read How to Change Timezone in Salesforce

How to find 18 digit org id in salesforce

In this section, we will learn how to find 18 digit org id in salesforce. We are going to demonstrate it on the salesforce lightning but these steps will work for salesforce classic as well.

In the previous few sections, we have shared how to find salesforce id using salesforce dashboard and how to get salesforce id from developer console.

Using the salesforce dashboard you can get 15 digits org id in salesforce

how to find salesforce org id
15 digits org id in salesforce

Whereas using developer console you can get 18 digits org id in salesforce. You can use either the Anonymous window or pass the query in the Query Editor. Using both you can find 18 digit org id in salesforce.

How to find 18 digit org id in salesforce
How to find 18 digit org id in salesforce using code
How to find salesforce organization id
How to find the 18-digit org id in salesforce using the query editor

This is how to get the 18-digit org id in salesforce.

Read How to create report in salesforce

How to find salesforce instance id

The salesforce instance is the server on which your salesforce organization is running. The instance id is the unique id value assigned to the salesforce server of an organization.

Do you want to know how to find the salesforce instance id? Read the full blog.

The instance id can be retrieved through :

  • Salesforce Dashboard
  • Developer Console
  • Command prompt or terminal

Read: How to Create Custom List Button in Salesforce

Find salesforce instance id through the salesforce dashboard

Instance ID has the information of the server and it can be found on the salesforce dashboard under Company information.

Follow these steps to find salesforce instance id through the salesforce dashboard:

Step 1: On the salesforce, dashboard click on the gear icon on the top right corner and then click on the setup.

Salesforce developer edition cancel account for developers
Salesforce developer edition cancel account for developers

Sep 2: On the Quick Find search for company information under the Organization Detail at the bottom right you will see instance. In our case it is NA206.

How to search salesforce id
Find salesforce instance id through the salesforce dashboard

This is how to get the salesforce instance id through the salesforce dashboard.

Read: How to Create Queues in Salesforce

Find salesforce instance id through Developer Console

The salesforce developers have access to the developer account where using the apex code or SQL they can find the salesforce instance id in salesforce developer console. Write the below code on the Query Editor to find the salesforce instance id.

SELECT InstanceName FROM Organization
How to search salesforce id
Find salesforce instance id through Developer Console

Find salesforce instance id through cmd or terminal

Command Prompt is a Microsoft Window tool whereas the terminal is available in Linux and Mac OS. You can find the salesforce instance id using command prompt or terminal based upon your operating system through the nslookup command.

Microsoft Windows users can use command Prompt (cmd)

Step 1: To start the command prompt (cmd) press win + r and type cmd on the run box.

Step 2: type nslookup followed by the complete company domain name.

nslookup tsinfotechnologies-dev-ed.lightning.force.com
How to search salesforce id
Find salesforce instance id through cmd or terminal

Linux and Mac Users can follow the below command on the terminal

Step 1: Start Terminal on the mac or Linux operating system

Step 2: type nslookup followed by the complete company domain name.

Their first new letters of the name are the instance id for salesforce. With this, we have covered How to find salesforce instance id using different ways.

You may also like How to Set Tab Style in Salesforce

How to find sandbox org id in salesforce

A sandbox environment is a replica of the main production environment. All kinds of testing & new features are first implemented on the sandbox and if the results qualify the expectation criteria then only released to production.

The 15-character organization id is the sandbox org id in salesforce is the sandbox org id in salesforce.

To find the sandbox org id in salesforce, login to your salesforce dashboard, and from there click on the view profile icon present at the top right corner of the screen.

From the Quick Find, search for Company Information, and there under Organization Detail, you will find Salesforce.com Organization ID.

How to find sandbox org id in salesforce
How to find sandbox org id in salesforce

In this section, we have learned how to find sandbox org id in saleforce.

Read How to install and use Salesforce Inspector

How to find salesforce id for an account

Every user in salesforce has a unique id for an account. To find the salesforce id for an account click on the view profile and from there click on your account name.

Your profile will open with all the relevant details. Look at the URL of this page there you will find 18 digits account id.

In the below image, 0058V00000BhJ4AQAV is the Account Id present on the URL of the profile page in salesforce. This account ID is also called user ID or user object ID.

How to find salesforce id for an account, How to find salesforce user id, How to find salesforce user object id
How to find salesforce id for an account

So in this section, we have learned how to find the account Id in salesforce. The account id is also called user id in so you refer to this section for How to find the salesforce user id as well.

Also, check: How to Create Public Groups in Salesforce

Conclusion:

In this tutorial, we have learned how to find salesforce org id. We have also learned how to find salesforce instance id using salesforce dashboard, cmd, and developer console. Also, we have covered these topics: