Skip to content

Support DISTANCE function #42

Description

@HenryRLee

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions