+ Start a Discussion
Chad MoutesChad Moutes 

Formula Field for Nearest Airport

I am trying to create a Formula Field that displays the name of the nearest Airport to the Account's Billing address.

I was handed this task about a week ago, and have triede everything that I can think of and have researched it thouroughly and have come up dry. I am really hoping that one of you lovely developers on here will have some advice for me as to how i should attempt to accomplish this task.
logontokartiklogontokartik
Well this is a very broad question
Can you please let me know if

Do you have all airports and addresses listed in your org currently or can you use any APIs to get them?
Does it need to be a formula field only or can it be an Apex Code ?
Does the airport needs to be just the name of should it be part of a Map?




 
Chad MoutesChad Moutes
I have yet to get the list into my org, and yes Apex Code is definitly a possibility, and either a field that displays the name, or maybe a section on the layout that displays the google maps location of the airport.
Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Chad Moutes:

I can suggest you couple of ways, not sure if it can really solve your issue but worth trying below:


 Does an embeded Google Map work for you instead of a formula field which you can embed on standard detail page or even on visual force?
If so try this:
https://developers.google.com/maps/documentation/embed/guide
If you can pass the address of the Account with airport nearby suffix, you can get better recommendations!

For that you need to signup to google to get the API key, instructions were in the link provided.

Also refer to this link:

http://forceguru.blogspot.com/2012/01/integrating-google-maps-in-salesforce.html


Or else, you might need to have all the airport information and geo location saved in an object, and have a trigger which determines which is the closest airport based on the billing address geo loaction. You could make use of GEO location fields in salesforce for this, you could use the below link:
https://help.salesforce.com/HTViewHelpDoc?id=custom_field_geolocate_overview.htm&language=en_US



Thanks,
Balaji
Chad MoutesChad Moutes
I would prefer to do a field that just displays the name of the airport.

Like for instance if the Account is Quicken Loans Arena, then I want the field to display Cleveland Hopkins Airport.

Any ideas?
Sonal Aggarwal 5Sonal Aggarwal 5
Although i am new to salesforce so i would like to know can this be done by Field Dependencies.I mean it can return a list of Airports on the basis of the city entered or any other key value.