This guide describes how to use the Salesforce Maps Apex Developer API to manage records, create routes, get routes, and more.
This guide describes the Apex methods that developers can use to perform Salesforce Maps operations without using the user interface, such as returning travel distances and times between locations, getting geographical coordinates for addresses, and retrieving geometric data for areas and perimeters. It is published as version 59.0, Winter ’24, and was last updated on September 28, 2023.
The guide first lists requirements—Apex class access through Enterprise, Unlimited, or Developer Editions, an installed Salesforce Maps package, and the appropriate Salesforce Maps license—then documents each method in the maps.API class, including AssignRecords(), CreateRoute(), route retrieval, boundary information, distance matrices, batch geocoding, dataset and alignment deletion, and territorial data lookups. Sample code, responses, and notes on avoiding uncommitted work errors are included throughout.
| Document version | 59.0, Winter ’24 |
|---|---|
| Required editions | Enterprise, Unlimited, or Developer Editions |
| Required license | Salesforce Maps or Salesforce Maps Advanced |
| Additional license for location methods | Salesforce Maps Live Tracking |
| Apex namespace | maps |
| API class | maps.API |
| AssignRecords signature | maps.API.AssignRecords(String, List |
No. The guide states that Apex methods don’t count against org API limits.
You need access to Apex classes through Enterprise, Unlimited, or Developer Editions, Salesforce Maps installed, and a Salesforce Maps or Salesforce Maps Advanced license.
Call the methods through a future method or call them as queueable.
It creates a record that includes a list of waypoints that reps access in Salesforce Maps; the record doesn't include a route between waypoints.