You need to sign in to do that
Don't have an account?
Shoshinsha81
DISTANCE( BillingAddress, GEOLOCATION(37.750,-122.203), 'mi' ).
I'd like to display the distance between the "BillingAddress" and the given location above "ISTANCE( BillingAddress, GEOLOCATION(37.750,-122.203), 'mi' ) in MILES.
Thanks in advance. :)
Thanks in advance. :)
James Loghry
You'll need to get the BillngAddress's longitude / latitude somehow (such as calling a third party web service or api). Store that in a location field (presumably on the Account or standard object you're referring to), and then use the Location class and built in Halversine distance calculation method in Apex to calculate the distance. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_system_Location.htm