Geopointe

Records Not Geocoded Due to Validation Rules

Validation rules can interfere with Geocoding. In this document, learn why this happens and how you can resolve such errors. 

Understanding the data model is a good first step. For every object you want to map, standard or custom, the Geopointe application requires a lookup field to a special object called Geocode. This Geocode object contains all the position information we need to plot the record on the map. During the geocoding process we we take the address from a record, retrieve the latitude and longitude coordinates, put this information in a Geocode object, and then link this Geocode object to the original record by populating the Geocode lookup field.

Validation Rules can sometimes prevent this Geocode lookup field from being updated. For example, perhaps there is a validation rule that always requires the Industry field on Account to be populated:

ISBLANK(TEXT(Industry))

In this scenario, the Geocoding process will not be able to update the record with the related Geocode record for Account records. where the Industry field is blank.

There is a simple fix for this. We also want to check and see if the Geocode lookup field is changing during the update. If it is changing, this update is most likely occurring from the automated Geocode process and we do not need the validation rule run. It can be changed to this:

AND(
   NOT(ISCHANGED(geopointe__Geocode__c)),
   ISBLANK(TEXT(Industry))
)

This validation rule will no longer block the Geocoding process.