Introduction
Salesforce CRM can gives many of data type fields to get information from users and store it in our org. This information includes name, date of birth, birth time, work location, email, mobile number, etc.…
Salesforce has provided a new data type called Geo-Location. This data type can store latitude and longitude information in decimal form to calculate distance.
By reading this article, you will learn about how to create a Geo-Location field data type in salesforce org.
Prerequisites
- Before starting this process, you must sign up in the Salesforce Trailhead lightning platform. Click here to sign up
Step 1
Login to trailhead and Launch “trailhead playground” or “Developer Edition”
Step 2
Click the “Gear” icon and then click the “Setup” option.
Step 3
In the setup page, click the “Object Manager” at top of the page.
Step 4
Read my previous article on how to create a custom object in the salesforce lightning platform.
On the bject manager page, scroll down and click the created our custom object name from the object list.
Step 5
In our created custom object page, click the “Fields & Relationship” option from the left side pane.
Step 6
Next, in fields and relationship page our predefined fields are listed. Now we are creating a new Geo-Location field from datatype by clicking the “New” button.
Step 7
On the next page, many data types are listed on the page. Select the “Geo-Location” data type radio button from the list and then click the “Next” button.
Step 8
Enter all required fields and then click the “Next” button.
Step 9
Next, in field-level security page check if the “Visible” checkbox is checked and then click the “Next” button.
Step 10
On the Add to page layout page, click the “Save” button.
Our created object displays in our fields and relationship page.
Test Our Created Geo-Location Data Type Field
Step 1
Click the “App launcher” icon at the top left corner on the page and then click the “View all” option.
Step 2
The app launcher pop-up window will be opened. Search our created object name in the search box and then click the object name.
Step 3
Our object page will be opened, click the “New” button.
Step 4
In the pop-up window, enter the all details in the required field and scroll down to last. Our created Geo-Location field will be displayed with both filed asking to enter your latitude and longitude number, then click the “Save” button.
Summary
Finally, we created a Geo-Location data type field and then tested it successfully. You can store work location latitude and longitude.