When you add a street address to certain types of field service records, Salesforce calculates the address’s latitude, longitude, and location accuracy. You can reference this data, which is visible only in the API, in any custom field service applications.
|Available in: Salesforce Classic and Lightning Experience|
|Available in: Enterprise, Performance, Unlimited, and Developer Editions with the Service Cloud|
This location data feature, known as “geocoding”, is enabled for all supported field service objects when you enable Field Service Lightning. In the API, you’ll notice values in the following three fields on work orders, work order line items, service appointments, service territories, resource absences, and service territory members:
|Latitude||The latitude of the street address.|
|Longitude||The longitude of the street address.|
|GeocodeAccuracy||The accuracy of the latitude and longitude. This field contains one of the following values, listed in order from most to least accurate:|
- Address—In the same building
- NearAddress—Near the address
- Block—Midway point of the block
- Street—Midway point of the street
- ExtendedZip—Center of the extended zip code area
- Zip—Center of the zip code area
- Neighborhood—Center of the neighborhood
- City—Center of the city
- County—Center of the county
- State—Center of the state
- Unknown—No match for the address was found (for instance, the address is invalid)
- Keeping Geocoding Data Current
- Salesforce periodically refreshes these three geocoding fields to ensure their accuracy. The refreshes are managed by a feature known as “clean rules” (because they keep your data clean and current!). A record’s geocoding fields are refreshed when:
- The record is created or updated
- The record type’s clean rule is deactivated and reactivated
- Allow some time for the geocoding fields to refresh. The amount of processing time varies based on how many records are being updated at once.
- If bulk geocoding is turned off for a clean rule, deactivating or reactivating the rule does not refresh the geocoding fields. Bulk geocoding is enabled by default.
You can keep an eye on the status of a record’s geocoding data in several ways.
- If you’re using Salesforce Classic:
Add the Clean This Record with Data.com related list to the detail page layout of the records you’d like to track. The related list includes:
- The time the record’s geocoding data was last refreshed.
- The record’s geocoding status. To learn what each status means, see Data.com Clean Statuses. The In Sync status means that your geocoding data is current.
- A Clean link which lets you manually run an instant refresh.
- If you’re using Lightning Experience
On the record, select Check Clean Status
in the action drop-down menu to view its geocoding status.
- How to Opt Out
- If you’re already using another geocoding service and prefer not to use this feature, you can opt out of Field Service Lightning geocoding.
- From Setup, enter Data.com in the Quick Find box, then select Clean Rules under Data.com Administration.
- Find the entries for Field Service Lightning and click Deactivate next to each rule:
- Geocodes for Work Order Address
- Geocodes for Work Order Line Item Address
- Geocodes for Service Appointment Address
- Geocodes for Service Territory Address
- Geocodes for Service Territory Member Address
- Geocodes for Resource Absence Address
- If you’re using the Field Service Lightning managed packages, opting out of geocoding means that latitude, longitude, and geocode accuracy are no longer calculated for field service records. Without this geocoding data, the scheduling optimizer doesn’t function properly.
- If you were using work orders before Winter ’17, enabling Field Service Lightning automatically turns on geocoding for all existing work orders in your org and populates their geocoding fields. If you don’t enable Field Service Lightning, the geocoding feature isn’t available for work orders.