You need to sign in to do that
Don't have an account?
:) :) :) :) :)
Geolocation query error
I am making visualforce with custom controller with find the nearest distance contact from selected contacts using (https://www.salesforce.com.com?id=16digit_contactID)
String q = 'SELECT Name FROM Contact WHERE DISTANCE(Location__c, GEOLOCATION('+String.valueOf(lat)+','+String.valueOf(log)+'), "mi") < 10';
List<Contact> contacts = Database.query(q);
Error: no viable alternative at character ' " " '
The documentation is wrong. the units value (miles / km) has to be surrounded by single quotes, not double quotes.