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
Nick KeehanNick Keehan 

Salesforce1 Longitude and Latitude Capture

Hi Guys.

I am looking to capture the longitude and lattitude when a lead is updated in salesforce via salesforce1.

Ideas:
  • I originally thought a javascript button would work, aparantly Javascript buttons cannot be used in salesforce1.
  • Visualforce page, I can capture on a VF page however the loading of the VF page via salesforce1 is slow and cumbersome as its not part of the app itself.
Does anyone else have any ideas?

Nick
 
Best Answer chosen by Nick Keehan
SandhyaSandhya (Salesforce Developers) 
Hi Nick Keehan,

You can write the Visualforce page contains JavaScript that captures the device's longitude and latitude when the record is saved. After writing the Visualforce page, you can create a tab for the page and add the tab to the mobile application.

Please refer below recipe given by salesforce developer guide

http://developer.force.com/cookbook/recipe/retrieving-a-user-s-location-from-a-gps-enabled-phone 

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya