function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mayureshbhoytemayureshbhoyte 

finding distance using geolocation field

I want to find the diatance between two places. I'm creating custom object with a custom field of data type Geolocation. What should I do next?

Ken KoellnerKen Koellner

Unfortunately that document really doesn't answer the question.

 

What is really needed is a function like --

 

Double miles = distance(myObj1.myLocation_latitude__s, myObj1.myLocation_longitude__s, 41.1234, -71.5678, 'mi');