Step 1: Update you Lead address with Latitude,Longitude field not showed in page layout. if you dont know the lat and long do the below steps. You have to wirte a batch apex to update your lat and long based on your lead address. connect googleAPI to find out Lat and long for postal code and address which you paased as JSON parameter for googleAPI it will return lat and lang.
after upadted lead information make sure you dont ave any null values for lat and lang using this query.
"SELECT count(id) FROM Lead WHERE Latitude != null AND Longitude != null"
then use your apex to to find lead within 50 miles using that main postal code lat and long.
hope this will give some idea to gohead with your code process.
Step 1:
Update you Lead address with Latitude,Longitude field not showed in page layout. if you dont know the lat and long do the below steps.
You have to wirte a batch apex to update your lat and long based on your lead address. connect googleAPI to find out Lat and long for postal code and address which you paased as JSON parameter for googleAPI it will return lat and lang.
after upadted lead information make sure you dont ave any null values for lat and lang using this query.
"SELECT count(id) FROM Lead WHERE Latitude != null AND Longitude != null"
then use your apex to to find lead within 50 miles using that main postal code lat and long.
hope this will give some idea to gohead with your code process.
Thanks
karthik