Loading

Batch Automation for Geocoding records in Salesforce Maps

Publiseringsdato: May 4, 2026
Beskrivelse

Salesforce Maps can geocode batches at scheduled intervals. This can accelerate the processing of records in Salesforce Maps. For example, when you plot records in Salesforce Maps, the plotting process may take somewhat longer depending on whether or not the records need to be geocoded. Scheduling geocoding batches at regular intervals can reduce this overhead.

Løsning

Batch Options

1. Navigate to Setup | Installed Packages. Select Configure next to Salesforce Maps.
2. Select the Automation tab.
3. Note that in Automation, you have several options regarding batches.

  • Schedule New Batch: This allows you to schedule a new geocoding batch that runs at specified time intervals.
  • Run Manual Batch: A manual batch allows you to run a single geocoding batch. You may want to do this if you have just imported/created a large number of records and want them geocoded.
  • Last 5 Batches Ran: This option just shows the last 5 batches that ran and details about their status.
  • Scheduled Batches: This option shows any scheduled (upcoming) batches and the times that they'll run.


Scheduling a New Batch

If you want to schedule a new batch, you need to supply the following information:

  • Batch Name: A descriptive name for the batch.
  • Apex Class: Leave this on the GeoCoderSchedulable class.
  • Base Object: This is the base object you wish to geocode.
  • Frequency: You can select either weekly or monthly. If you're scheduling a weekly batch, note that you can select as many as 7 days (which has the effect of scheduling the batch daily). For monthly, you can request that the batch run on a particular day of the month. Lastly, you can configure a preferred start time for when the batch starts.


Running a Manual Batch

When you run a Manual Batch, you only need to select the Base Object. You then have a few different options.

  • Start Geocoding Batch: Starts a batch that geocodes all records for the given Base Object.
  • Start Lat/Long Removal Batch: Starts a batch that clears the latitude and longitude for the given Base Object. This may be helpful if you want fresh geocodes for your records
  • Start Skip Geocode Flag Removal Batch: Starts a batch that clears the Skip Geocode Flag. During the process of geocoding, records can be marked as having a Bad Address (if the address information is invalid). If a record is marked as a bad address, we skip it in the next geocode batch. Running this batch will remove that flag and allow you to run a Geocoding Batch to geocode those records.
Note: To use the Start Skip Geocode Flag Removal Batch feature mentioned above, you need to meet the following prerequisites:
  1. Create a custom field on the Salesforce object that you're trying to geocode
    • Name: MASkipGeocoding
    • API Name: MASkipGeocoding__c
    • FieldType: Checkbox
  2. Make sure to select the 'Skip Failed Geocodes' checkbox on the corresponding Maps Base object 
    • Setup => Installed Packages => Configure next to Salesforce Maps => Base Object tab on the left-hand side.

 

Things to consider with Batch Automation for Geocoding in Maps:

  • Our geocoding batch size is hardcoded to 10 records.
  • Lat/Long Removal is 500 records per batch.
  • Salesforce governor limits for Asynchronous Apex (background processing outside a user session) restrict batch executions to 250,000 per 24 hours. 
  • The number of records you're trying to process. One geocoding job can process up to 250,000 records at a time. 
  • Any automation on the object that wouldn't allow the coordinates to be saved on the record or invoke a process or trigger.
  • Users who don't have the "API Enabled" permission and access to the "Name" field within the ApexClass object won't have the ability to view the scheduled batches tab. This is usually seen in Professional and Group edition Salesforce orgs.
  • The records that already contain geocodes will be skipped by the batch process.
Knowledge-artikkelnummer

000389884

 
Laster
Salesforce Help | Article