How to display the list of nearby accounts using the geo location feature of latitude and longitude
Our Sales persons are always on the road. When they visit a customer (Account), they like to find out is there another customer (Account) nearby where they can visit for maximum utilization of their time. I know this scenario can be automated using the Geolocation feature. I have a formula field on the account object Location_Address__c
Formula is ShippingStreet + ' ' + ShippingCity + ' '+ ShippingState + ' '+ShippingPostalCode
On the Account object I have the Shipping Latitude and Shipping Longitude fields on my page layout which gives me the latitude and longitude.
My requirement is to have a Get NearBy” button on the detail page of Account record or have something similiar which can fethch the nearby accounts.
When the user will click on this record, we will display a list of nearby Accounts sorted by distance from the current account. The Salesperson can then decide which customers he will like to visit.
I know we can use SQL query but I am not sure how to populate the nearest accounts.
I have already activated the Data Integration Rules for account object. I havea activated Geocodes for Account Shipping Address and Geocodes for Account Billing Address for account object.