+ Start a Discussion
Michael Hedrick 2Michael Hedrick 2 

Save latitude and longitude to record

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.  
Best Answer chosen by Michael Hedrick 2
Maharajan CMaharajan C

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Michael,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.



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
Michael Hedrick 2Michael Hedrick 2
Hello Khan,
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.

Maharajan CMaharajan C
This was selected as the best answer