How to filter model by distance
Is it possible to create a filter condition that limits records based on distance. For example if have a custom Geocode field on Contact named Location__c I would like the filter to result in a SOQL query like SELECT Id FROM Contact WHERE DISTANCE(Location__c, GEOLOCATION(latitude,longitude), 'mi') < miles Ideally I would also like the values for latitude, longitude and miles be fitlerable. I'd like to combine this so that geocoordinates from my position or clicking a certain position on a map limits the model results.
3
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
Thanks, Greg
like: ORDER BY DISTANCE(GeoC__c, GEOLOCATION(22.5697,
88.3697) , 'mi') like you do can in SOQL?
ideally GEOLOCATION() parameters should come from another model as well.