Mobile devices, by their very nature, are used on the move and applications often need to capture the location of the user in order to provide the best user experience; for example, showing proximity to a business or services, or allowing them to check-in at a destination.
In this recipe we will create a mobile Visualforce page to capture a lead and the location of the user. The location will be stored on the lead record in the Salesforce database.
This recipe requires a custom field on the lead sObject to capture the location.
Navigate to the lead fields setup page by clicking on Your Name | Setup | App Setup | Customize | Lead | Fields.
Scroll down to the Lead Custom Fields and Relationships section and click on the New button.
On the next page, Step 1. Choose the field type, select the Gelocation option from the Data Type radio buttons and click on the Next button.
On the next page, Step 2. Enter the Details, enter
Location
in the Label field, enter...