• Jason A Hoult
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Certified Admin

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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.