Geolocation custom fields
Key Takeaway
A Geolocation field is a read-only compound field, so you change its value through its latitude and longitude components. Support for the compound field and its components varies by feature.
A Geolocation custom field stores a location as a latitude and longitude pair, so you can calculate distances between places. It is a compound field: one field built from separate latitude and longitude components. Most of the tricky behavior comes from knowing where the compound field works and where you must use its components instead.
Latitude and longitude values
Users specify a location in a Geolocation field by its latitude and longitude. Latitude values must be between -90 and 90. Longitude values must be between -180 and 180.
Salesforce can automatically add or update Geolocation fields, but only when all three of these conditions are true:
- The org uses Developer, Professional, Enterprise, Unlimited, or Performance Edition.
- The record is an Account, Contact, Lead, or WorkOrder record.
- You have enabled the geo data integration rule for each object.
For all other objects and editions, you must set latitude and longitude using SOQL, the SOAP or REST API, or a geocoding service. You can find geocoding services on AppExchange.