This Salesforce tutorial will teach us how to create a geolocation field type in Salesforce. We can use it to identify the location by their latitude and longitude to calculate the distance between the locations. We can use the geolocation field anywhere the user wants to define the location. Moreover, we will focus on some of the practical scenarios for implementation.
Recently, I worked in the Salesforce company that is placed in the USA. While working here, I got a task where I needed to enter the defined location of the office under the employee details who work in the company. This geolocation defines where our office is located. To fulfill this requirement, I use the geolocation Field Type, which is present under the Field and Relationship.
So, as a solution, I discovered the geolocation field that helps in finding the location of the office where the employee office is located. It is a custom field that permits us to identify locations by their latitude and longitude and calculate the distance between them. Let’s go into more detail about creating the geolocation field type in Salesforce Lightning and Salesforce Classic.
Geolocation field type in Salesforce
The geolocation field type is defined as a field type that permits the users to identify the location by their latitude and longitude to calculate the distance between the locations.
It is a compound field that adds up org limits as three custom fields first one for latitude, the second one for longitude, and the third one for internal use. It is not available for external use.
Let’s take an example. There is a Cisco company in the USA, and many employees are working in this company. There is a need to add the office’s location under all the employee’s details section, which defines the location where the office is located. This office location is added by simply using the geolocation data type, and this geolocation data type is present under the Field and Relationship.
Now, let’s move further and see how to create the geolocation field type in Salesforce Lightning and Salesforce Classic.
Read How to Create Date Time Field Type in Salesforce
How to create a geolocation field type in Salesforce Lightning
Here we are creating the geolocation field type in Salesforce Lightning. Here we are taking an example we are using the Business Brand object inside the Business Brand object we want to add the Office Location as a geolocation field.
There is a Cisco company in the USA. In this company, lots of employees are working there is a need to add the location of the office under all the employee’s details section, which defines the location where the office is located, and this office location is added by simply using the geolocation data type and this geolocation data type is present under the Field and Relationship.
If you want to learn how to create the geolocation field type in salesforce lightning, follow these steps:
Step-1: Login into your Salesforce lightning account, Go to the gear icon. Under the gear icon, there are two options present first one is Setup, and another one is Service Setup. Here we are clicking on the Setup option.
After clicking on the setup option, the setup page is open. Click on the Object Manager at the nav bar near the home tab.

Step-2: The Object Manager page opens after clicking on the Object Manager. Here we can see lots of objects are present. Here we want to select the Business Brand object. To select the Business Brand object, enter the Business Brand object in the search box. The Business Brand object comes at the top; click on the Business Brand object.

Step-3: The expense object page opens after clicking on the Business Brand object. Under the Business Brand object page is a details section in which field and relationship option is present. Click on the fields and relationship option.

Step-4: The field and relationships page opens after clicking on the field and relationship option. To create the field type, click on the new button presented at the top of the field and relationship page.

Step-5: After clicking the new button, the data type page opens. There are lots of data types present on the page. Here we are selecting the geolocation data type field presented at the bottom of the page.
The geolocation field type is defined as a field type that permits the users to identify the location by their latitude and longitude to calculate the distance between the locations. and then clicks on the next button.

Step-6: After clicking the next button, the Business Brand new custom field page opens. Now enter the details, first fill the field label as Office Location and then fill the Decimal Places as 10, after that, fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise leave the field the same.
After that, click on the next button presented at the top and the bottom of the page.

Step-7: After entering the details, now established the field-level security. Now select the profiles we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.
Click on the visible checkbox and then click on the next button presented at the top and the bottom of the established field-level security page.

Step-8: After establishing the field-level security, now add the custom field to the page layout. Select the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

Step-9: After clicking on the save button. The geolocation field type is created, go to the app launcher and enter sales in the search box. Select sales, the sales page is open and then select the Business Brand object presented in the nav bar.
The Business Brand object page is open, here you can see that on the right side of the page, there is a details section and under this section, we can see that the geolocation field type is created and we can enter the Office Location related to the Office Location column in the geolocation field.

This way, we understand how to create the geolocation field type in Salesforce Lightning. Let’s Proceed further and learn how to create the geolocation field type in Salesforce Classic.
Read How to Create Email Field Type in Salesforce
How to create a geolocation field type in Salesforce Classic
Here we are creating the geolocation field type in Salesforce Classic. Here we are taking an example we are using the Business Brand object inside the Business Brand object we want to add the Offline Location field as a geolocation field.
If you want to learn how to create the geolocation field type in Salesforce Classic, follow these steps:
1: First log in to the Salesforce account; when we log in, the Salesforce lightning edition is open. Moving to Salesforce Classic, click on the Profile picture. The Profile picture drop-down list is open. Under this profile picture list, there is an option to switch to Salesforce Classic. Click on it.
After clicking on the switch to Salesforce Classic option, click on the drop-down arrow of the username. The drop-down list is open, under this list Setup option is present below the My Profile option. Click on the Setup.

2: The setup page is open after clicking on the setup option. Enter the account in the Quick Find Box. The Accounts object comes at the top, click on the account drop-down menu. The drop-down list is open, under this drop-down list there is a field option. Click on the field option.

3: The accounts custom field page is open after clicking on the fields option. Scroll to the bottom of the page; there is an account custom field and a relationship section. For creating the new field click on the new button.

4: After clicking the new button, the data type page opens. There are lots of data types present on the page. Here we are selecting the geolocation data type field that is present at the bottom of the page.
The geolocation field type is defined as a field type that permits the users to identify the location by their latitude and longitude to calculate the distance between the locations. and then clicks on the next button.

5: After clicking the next button, the Business Brand new custom field page opens. Now enter the details, first fill the field label as Customer Location and then fill the Decimal Places as 10 after that fill the field name by simply clicking on the field, and the field name is automatically filled then fill the description if you want to fill otherwise leave the field the same.
After that click on the next button that is present at the top and the bottom of the page.

6: After entering the details, now established the field-level security. Now select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.
Click on the visible checkbox and then click on the next button at the top and the bottom of the established field-level security page.

7: After establishing the field-level security, now add the custom field to the page layout. Select the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

Conclusion
Geolocation in Salesforce is a compound field that adds up org limits as three custom fields first one for latitude, the second one for longitude, and the third one for internal use. It is not available for external use.
It is a field type is defined as a field type that permits the users to identify the location by their latitude and longitude to calculate the distance between the locations.
I hope you get to know how to create a geolocation field in Salesforce. Also, I have explained step by step how to create the geolocation field type in Salesforce Lightning and in Salesforce Classic.
You may also like:
- Create a Custom Lightning Record Page in Salesforce
- Create Number Field Type in Salesforce
- Create a Phone Field Type in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.