Get Started with Visualforce in the Salesforce App
- Describe three places where Visualforce pages can be used in the Salesforce app.
- Describe when it makes sense to build Salesforce apps with Visualforce.
- List at least three declarative tools you can use instead of creating mobile customizations with code.
- List at least three reasons to develop mobile apps in the Salesforce app instead of using the Mobile SDK.
The Salesforce app lets you stay connected and get things done wherever you are. Visualforce helps you create functional—and beautiful—mobile interfaces customized to fit your needs. If you’ve already been developing in Visualforce for desktop, you can apply the same skills to mobile development. Your users can take the functionality you provide with them, finding leads, closing deals, and more from their phones.
The Salesforce app provides a lot of functionality built right into the mobile application. Often, you can extend the Salesforce app for your organization’s needs without writing a single line of code. But when you want to build more customized applications, you can do it with Visualforce.
The Salesforce app and Lightning Experience are built on the same Lightning platform. They are visually similar and follow the same style guidelines, making them good partners. In this module, we use Lightning Experience for demos and steps on your desktop. But don’t worry if your company still uses Salesforce Classic! Some sections in Setup have new names and the output sometimes looks a bit different, but you can follow along no problem.
- Navigation menu—available when you tap from the mobile app
- Action bar and action menu—available from the bottom of any page
that supports actions
- Record related information page (as a mobile card)—available when
you navigate to a record
- Are usually faster and cheaper to build.
- Generally require less maintenance.
- Receive automatic upgrades when the tools are improved.
- Aren’t subject to governor limits.
- Quick Actions
- Page layout customization
- Formula fields and roll-up summary fields
- Validation rules
- Workflows and approval processes
- Custom fields and objects
- Support specialized or complex business processes.
- Provide highly customized user interfaces or customized click-through paths.
- Connect to or integrate with third-party systems.
- Defined user interface.
- Full access to Salesforce data.
- Possible integrated experience in the Salesforce app.
- Inclusion of your own apps and functionality with quick actions.
- Customized with point-and-click or programmatic tools.
- Programmatic functionality through Visualforce pages, Canvas apps, and the Lightning Component framework.
- Defined navigation points, since customizations or apps adhere to the navigation menu. For example, a Visualforce page can be called from the navigation menu or from a custom action in the action bar.
- Enables you to leverage existing Salesforce development experience, both point-and-click and programmatic.
- Included in all Salesforce editions and supported by Salesforce.
- A custom user experience.
- A branded user interface, including a custom app icon, for increased exposure in customer-facing apps.
- App distribution through mobile industry channels, such as the Apple App Store or Google Play (Mobile SDK only).
- Control of complex offline behavior (Mobile SDK only).
- Push notifications (available for Mobile SDK native apps only).
- A custom security container using your own OAuth module (Mobile SDK only).
- Access to open-source SDK, downloadable for free through npm installers and GitHub. No licensing required.
- Requires you to develop and compile your apps in an external development environment (Xcode for iOS, Eclipse or similar for Android).
There’s no right or wrong answer when choosing between the Salesforce platform and the Mobile SDK. Base your choice on which features are most important for your app.
The Developer Console, the Force.com IDE, and the Setup editor all work in the Salesforce app, Lightning Experience, and Salesforce Classic. The Visualforce Development Mode footer is only available in Salesforce Classic.
The main difference between developing in Lightning Experience and the Salesforce app is how you view and test your pages during development.
In Salesforce Classic, you can view your page using the https://yourInstance.salesforce.com/apex/PageName URL pattern. This doesn’t work in Lightning Experience, because pages you view using direct URL access always display in Salesforce Classic. To view your page in Lightning Experience, access the Lightning Experience container app with /lightning.
It’s important to test your Visualforce pages before deploying them in production. Test your pages across different environments, devices, and users. For instance, we don’t recommend developing for the Salesforce app exclusively on your desktop or laptop and testing your pages by navigating to the /lightning URL. The Salesforce app and Lightning Experience share the /lightning container depending on the device that connects to it. While you can fool /lightning by changing your browser’s user agent, this can lead to bugs down the line—desktop and mobile browsers can behave very differently.
Running the Salesforce app in an emulator isn’t supported for normal use. We understand that device emulators are convenient. But they aren’t a substitute for full testing of your custom apps and pages on your organization’s supported mobile devices. During development, regularly test your app on every device and platform on which you intend to deploy.
To test code we write in this module on your mobile device, use your Trailhead playground’s username and password to log in to the Salesforce app. To find your Trailhead login info, see this article. You can download and install Salesforce from Google Play or the App Store.
- Salesforce Mobile App Developer Guide
- Using Visualforce in Salesforce (SlideShare)
- Visual Development – When to Click Instead of Write Code (blog post)
- Trailhead: Visualforce & Lightning Experience
- Trailhead: Lightning Experience Development: Use Visualforce in Lightning Experience
- Dreamforce session: Intro to Salesforce Mobile App Development with Visualforce
- Dreamforce session: Clicks or Code: When to Use Configuration or Custom Development
- Dreamforce session: Developing on the Salesforce Platform With Clicks, Not Code