The Address field are no longer allowed in order by clause in Soql query (After Spring 18 )
Last updated 2018-01-23 ·Reference W-4607035 ·Reported By 13 users
Some customers using the Address field in order by clause in Soql query see the below error:
"BillingAddress field can not be sorted in a query call".
Run below query in Dev console or Workbench in Spring 18 Sanboxes
SELECT Website, Phone, Name, Fax, BillingStreet, BillingPostalCode,
BillingCity, BillingState, BillingLongitude,
WHERE DISTANCE(BillingAddress, GEOLOCATION(37.775,-122.418), 'mi') < 20
ORDER BY DISTANCE(BillingAddress, GEOLOCATION(37.775,-122.418),'mi') ASC, Name ASC
The query should run fine and give us results
We receive the below error
[object Object]: 'mi') < 20 ORDER BY DISTANCE(BillingAddress, GEOLOCATION(37.775 ^ ERROR at Row:1:Column:326 field 'BillingAddress' can not be sorted in a query call
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.