Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DISTANCE function #42

Open
HenryRLee opened this issue Nov 25, 2019 · 0 comments
Open

Support DISTANCE function #42

HenryRLee opened this issue Nov 25, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@HenryRLee
Copy link
Contributor

HenryRLee commented Nov 25, 2019

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_geolocate.htm

I haven't come up with a design yet.

Anyway, the feature is still available by manually feeding the whole DISTANCE expression to the first parameter of the methods addConditionXX or orderBy.

For example:

new Query('Account')
.addConditionGt('DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), \'mi\')', 10);
new Query('Account')
.orderBy('DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), \'mi\')', 'DESC');

It's just this way of coding does not fit the style of Query.apex.

@HenryRLee HenryRLee added enhancement New feature or request help wanted Extra attention is needed labels Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant