Try It Out: Create a Visualforce Page

Now we’ll create a Visualforce page and make it available from the navigation menu.
This Visualforce page references these items:
  • A static resource named googleMapsAPI
  • An Apex class named findNearby
These have been provided for you in the package that you downloaded and installed for this guide.

Also included in the package is the Visualforce page FindNearbyWarehousesPage. You can move on to the next step, if you want to use the page included in the package.

The code for this page uses the location of the current user and integrates with Google Maps to display a map with warehouses located within 20 miles. For each nearby warehouse, the map displays a pin along with the warehouse name, address, and phone number.
  1. In the Salesforce application, from Setup, click Develop | Pages.
  2. Click New.
  3. In the Label field, enter FindNearbyWarehousesPage. The FindNearbyWarehousesPage page is included in the package you installed, so if you’re copying this code to create a new page, you’ll want to name your page something different.
  4. Select the Available for Salesforce mobile apps checkbox. Selecting this checkbox designates that the page is mobile-ready and can be used in Salesforce1.
  5. Cut and paste this code into the Visualforce Markup tab.
  6. Click Save.

Now that we’ve created the Visualforce page for finding warehouses, the next step is to create a tab for it. We’ll then add the page to the navigation menu in Salesforce1.