You need to sign in to do that
Don't have an account?

Save latitude and longitude to record
Hello,
Been trying to figure out how to save the latitude and latitude of the users current location when they save a custom record via a visualforce page. I was able to use
and this would grab the latitude but I have not been able to save the value to the record.
Is there a better way to aquaire the Lat and long of a users current location when the record is created and then saving the lat and long to the custom record.
Thanks
Been trying to figure out how to save the latitude and latitude of the users current location when they save a custom record via a visualforce page. I was able to use
document.getElementById('startLat').value=startPos.coords.latitude;
and this would grab the latitude but I have not been able to save the value to the record.
Is there a better way to aquaire the Lat and long of a users current location when the record is created and then saving the lat and long to the custom record.
Thanks
All Answers
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://www.thephani.com/how-to-save-current-location-using-visualforce-pages/
https://salesforce.stackexchange.com/questions/138429/how-to-get-current-user-geo-locationlongitude-latitude
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thank you for teh reply. I am actually suing something similiar to your first example and I am able to retrieve the lat and long but unable to pass the values to the custom record.
The second example is unclear to me. Are the new fields shown in step 2. !latt and !longt ?
Are they actually geo code fields or number fields with decimals? Not sure where these fields are defined.
Thanks