Salesforce Geolocation Field

Salesforce’s Geolocation Field is used to identify locations by their latitude and longitude and calculate the distance between them. We can use the geolocation field anywhere the user wants to define a location.

Recently, I worked in a Salesforce company. While working here, I received a task where I needed to enter the office’s defined location under the employee details. This geolocation defines where our office is located. To fulfill this requirement, I used the geolocation Field Type, which is present under the Field and Relationship.

In this Salesforce tutorial, I will explain the geolocation field and how to create a geolocation field in Salesforce Lightning and Classic interfaces.

Geolocation field type in Salesforce

The salesforce geolocation field 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: one for latitude, the second for longitude, and the third for internal use. It is not available for external use.

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.

See also  How to Change the Values Displayed in Lookup Field in Salesforce?

There is a Cisco company in the USA. In this company, many employees work. There is a need to add the office’s location under all the employees’ details section, which defines the location of the office. This office location is added by simply using the geolocation data type, which is present under the Field and Relationship.

Here are the following steps:

1. Go to the Gear icon –> Click on the Setup option –> Select the Object Manager tab.

Geolocation Field in Salesforce

2. Enter the Business Brand in the search box. Click on the business brand object.

Geolocation Field Salesforce

3. Select the Fields and Relationships option that is present under the details section.

Salesforce Geolocation Field

4. Here, we want to create a new field. So, for this, click on the New button.

Geolocation Salesforce

5. Here, we are selecting the Geolocation field Checkbox. The geolocation field type is defined as a field type that permits the users to identify the locations. Click on the Next button.

Salesforce Geolocation

6. 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 it. Click on the next button.

Geolocation Datatype in Salesforce

7. Now establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

Salesforce Geolocation Field Example

8. Now, add the custom field to the page layout. Select the page layout that should include this field. Click on the Save button.

How to create geolocation field type in Salesforce

9. 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.

See also  How to Delete the Picklist (Multi-Select) Value in Salesforce

The Business Brand record page is open. Here, you can see a details section. 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.

Create geolocation field type in Salesforce

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.

Here are the following steps:

1. Login into the Salesforce account –> Click on the Profile Picture –> Click on the Switch to Salesforce Classic option –> Select the Setup option.

Salesforce geolocation field type

2. Enter the Accounts object in the Quick Find Box. Click on the accounts drop-down arrow. Our accounts drop-down list is open. Select the Fields option.

Create a geolocation field type in Salesforce

3. Here, we want to create a new field. So, for this, click on the new button.

Salesforce create a geolocation field type

4. Here, we select the Geolocation checkbox field and click on the next button.

How to create geolocation field type in Salesforce

5. Now enter the details. First, fill in the Field Label as Customer Location and then fill in the Decimal Places as 10. After that, click on the field name to fill it in. Then, click on the next button.

Create geolocation field type in Salesforce

6. Now establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

Salesforce create geolocation field type

7. Now, add the custom field to the page layout. Select the layout that should include this field, and click the save button.

How to create the geolocation field type in Salesforce

Conclusion

I hope you understand how to create a geolocation field in Salesforce. I have also explained step by step how to create the geolocation field type in Salesforce Lightning and Salesforce Classic.

See also  How to Modify Standard Auto Number Fields in Salesforce?

You may also like: