From the wiki here I should be able to filter on distance by
$filter=geo.distance(location, geography'POINT(-122.131577 47.678581)') le 10
And I tried doing it with Javascript with no luck as JS has limits for the types of filters it can use. So I moved on to C#, but I'm stuck as I can see how the expression would look like. The documentation is a little poor, would be nice with an example but google ins't my friend. Anyways;
var latitude = 25.075648; var longitude = 4.746094; QueryExpression qe = new QueryExpression() { EntityName = qi.EntityName, ColumnSet = new ColumnSet(qi.EntityColumns), TopCount = 5, Criteria = { Filters = { new FilterExpression { FilterOperator = LogicalOperator.And, Conditions = { // ??? } } } } };
The entity is msdyn_workorder and it has msdyn_latitude and msdyn_longitude. Has anyone created a filter in C# with distance and how did you do it?
*This post is locked for comments