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
Andrea SloanAndrea Sloan 

How do I use Geocodes if I want to find nearby salesforce Contacts?

I've already activated  "Clean Rules " Geocodes for Contact mailing Address in Salesforce. I understand from the links I've read that the geocodes don't actually show up unless through a custom field.
1. How would I then create a custom field that shows the goelocations of my contacts' mailing address?
2. My Sales people want to go on roadshows and have contacts that are close to one another show up in the Google map if they show to be the Contact owner. How exactly do I achieve this? Can this be done on the UI through Geocodes? How? If this can't be done by showing up on a map then simply getting a list of the nearby contacts would be the second alternative.

I also saw another posting quoting below that has API code which I believe can achieve something in the lines of what I want. I'm not a developer and I don't fully grasp the  coding nor would I know how to put this inside a Visualforce page. in my case, my object would be Contacts and the geocodes would be that of the mailng Address.
Please help! thank you

<apex:map width="600px" height="400px" mapType="roadmap"
center="{!Account.BillingStreet},{!Account.BillingCity},{!Account.BillingState}">

    <apex:repeat value="{! MyObj__c.Addresses }" var="addr">
      <apex:mapMarker title="{! addr.Name }"
        position="{!addr.MailingStreet},{!addr.MailingCity},{!addr.MailingState}"
      />
    </apex:repeat>

 </apex:map>
SandhyaSandhya (Salesforce Developers) 
Hi,

Please refer below support article from salesforce which has the steps to do.

https://support.salesforce.com/articleView?id=data_dot_com_clean_admin_automatically_get_geocodes_for_addresses.htm&language=en_US&type=0


There is also an App in App Exchange see if that can help you. I have not tried for myself.

https://appexchange.salesforce.com/listingDetail?listingId=a0N30000001gpWhEAI
 
Hope this helps you!

If this helps you please mark it as solved.

Thanks and Regards
Sandhya
Andrea SloanAndrea Sloan
Hi Sandhya:

Thank you for this but I already had accessed both of the links you pointed out to. The first one although it does exlain how to create a custom formula to show the geocode on the screen, what it doesn't explain anywhere on the documentation is how to apply the geocode into something meaningful. I'm trying to see whether  the Google maps that we have in Salesforce under accounts and contacts which I have enabled, whether it could identify those geocodes that are in nearby proximity to the contact record that I'm actually on. If Google maps can't do this for me, then I'd like to know whether there's any way that I could set up a report that would show the list of contacts in proximity to the one I'm on at a given moment. The same for an account if it's at all easier to do.

The Nearby app I had already downloaded although the set up is not straightforward so I stopped the process. It didn't have that many good reviews, not sure if you noticed this. Anyhow, the main reason I hadn't continued at the time to test it was because it requried some kind of a Google API key which I don't know what that is, how to get it and whether it has a cost which I don't wish to pay. There's another app called MapPLotter which I don't know if you're familiar with and if it's any easier to install.
I was hoping that someone from the developer communitycould help me out set something out with some codes by applying Contacts' geolocations.