Many of our Continuous Integration builds just failed with hundreds of this error:

System.QueryException: No such column 'othergeocodeaccuracy' on entity 'Contact'.

Our code does describe calls to find all the Contact fields and then queries nearly all of them.

At first sight, it looks a field not mentioned here Geocode Fields and Accuracy, has slipped into the describe data (via a Salesforce patch?) but is not legitimate in a query.

Any other thoughts on cause?

  • Which release are you on? I just checked in my DE Org Spring '19 with a query SELECT OtherGeocodeAccuracy FROM Contact in a test class, query editor and it just works fine without any error. – Jayant Das May 8 at 22:04
  • Duh... and thanks @JayantDas - most likely is the API version as I had to change that to use the isEncrypted() describe method. Post that as an answer and I'll accept it when I've confirmed that it's the problem. – Keith C May 8 at 22:16
  • I added few details in the answer. The field is listed in the SOAP API docs as well. – Jayant Das May 8 at 22:30

For your question:

Is Contact othergeocodeaccuracy a legitimate field?

It does seem to be a legitimate field. The field is listed in the SOAP API docs with the following description:

Accuracy level of the geocode for the other address.

There is also a mention about using these fields in the Compound Field Considerations and Limitations docs.

Additionally, I also tried the below query in my personal DE Org (Spring '19, API v45.0) both in an Apex Class and Query Editor/Workbench, it worked fine without any issue.

SELECT OtherGeocodeAccuracy FROM Contact LIMIT 1 // works fine

As you have noted in the comments, the issue here turned out to be the API version of the Apex class where the SOQL was executed. Once the Apex class was upgraded to 45.0, it worked fine.

  • 2
    The problem was that I had moved the API version in the class that did the describe up to 45 from 30 but not in the class that did the query. Your comment pointed directly at that being the problem - thanks. – Keith C May 8 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.