• Nikolay Kolev 19
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I just noticed that one of my queries is no longer working in my sandbox after the Spring '18 has been applied to that sandbox.

In particular this is the error SF is returning:
[object Object]: 'mi') < 55 ORDER BY DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034 ^ ERROR at Row:1:Column:199 field 'Geo_Location__c' can not be sorted in a query call

The WHERE clause in my query breaks it and here's what that where clause looks like:
DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034, -112.0889634), 'mi') < 55 ORDER BY DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034, -112.0889634), 'mi')

The Geo_Location__c field is a geolocation type field. This is still working in Winter '18.
Do you know why this change was applied and if there's a workaround this?

Also if you look at SF's documentation they provide a very similar example in their code: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_geolocate.htm