You are here:
Schedule Geocoding Batch Jobs for Salesforce Maps Records
Apply geocodes to a large number of records in Salesforce Maps more quickly by processing records with geocoding batch jobs. You can run a one-off batch job or schedule batch jobs at daily, weekly, or monthly intervals. This automation can help you save time when plotting records that are missing geocodes in Salesforce Maps.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To customize settings: | Customize Application |
| To schedule Apex jobs: | API Enabled AND Access to the Name field on the ApexClass object |
Before you start a geocoding batch job, review these important considerations.
- Batch jobs are subject to Salesforce limits for asynchronous Apex method executions. See Execution Governors and Limits.
- Batch jobs skip any records that already have geocodes specified.
- Make sure that any automation on the object, such as triggers or flows, doesn’t prevent the saving of coordinates.
Go to Batch Options
- From Setup, in the Quick Find box, enter Installed Packages, and then select Installed Packages.
- Find the Salesforce Maps package and click Configure.
- From the left menu, select Automation.
The Automation page includes these tabs.
| Tab | Description |
|---|---|
| Schedule New Batch | Schedule a new geocoding batch that runs at time intervals that you specify. |
| Run Manual Batch | Run an unscheduled geocoding batch. Try this option after you import or create a large number of records. |
| Last 5 Batches Ran | Find the results of the five most recent geocoding batch jobs. |
| Scheduled Batches | Review any upcoming geocoding batch jobs that are scheduled to run. |
Schedule a New Batch
- On the Automation page, click the Schedule New Batch tab.
- Enter a descriptive batch name.
- For Apex Class, leave the GeoCoderSchedulable class selected.
- For Base Object, specify the object with the records that you want to geocode.
-
In the Schedule Apex Execution section, specify whether the batch job runs weekly or monthly, and specify a start time.
- For weekly frequency, select the days that you want the job to run each week. You can select up to seven days, which causes the job to run daily.
- For monthly frequency, specify the day of the month that the job runs.
- To save your changes, click Schedule.
Run a Manual Batch
- On the Automation page, click the Run Manual Batch tab.
- For Base Object, specify the object with the records that you want to geocode.
-
Select an option for running the batch.
- To geocode all records for the specified base object, click Start Geocoding Batch. The batch job geocodes records in increments of 10, up to 250,000 records total.
- To clear the latitude and longitude values for the specified base object’s records so that you have fresh geocodes, click Start Lat/Long Removal Batch. This batch job is limited to 500 records.
- To reset records with improperly formatted address values, click Start Clear Skip GeoCode Flag Batch. This option requires some additional customization in Salesforce, as described in the next section.
(Optional) Complete Prerequisites for the Skip Geocode Flag Batch
A geocoding batch job can identify records that have an improperly formatted address, which can cause the next geocoding batch job to skip those records. You can run a special batch to reset that flag on affected records so that you can run a new geocoding batch on them. This special batch job requires some additional customization in Salesforce.
-
From the object management settings for the base object that you want to geocode, create a custom field with these details. See Create a Custom Field.
- For Data Type, select Checkbox.
- For Field Label, enter MASkipGeocoding.
- For Field Name, enter MASkipGeocoding__c.
-
Turn on the Skip Failed Geocodes field for the base object.
- From Setup, in the Quick Find box, enter Installed Packages, and then select Installed Packages.
- Find the Salesforce Maps package and click Configure.
- From the left menu, select Base Objects.
- Select the base object.
- Turn on Skip Failed Geocodes.
- Save your changes.
- Return to the Automation page, run a geocoding batch, and then try Start Clear Skip GeoCode Flag Batch.

