Newer Version Available

This content describes an older version of this product. View Latest

Visualforce Components and Features to Avoid in the Salesforce App

Most core Visualforce components (those components in the apex namespace) function normally within the Salesforce app. Unfortunately, that doesn’t mean they’re optimized for mobile, or that every feature works with the app. You can improve the mobile user experience of your Visualforce pages by following some straightforward rules.

In general, avoid structural components, like <apex:pageBlock> and child components, and other components that mimic the Salesforce look and feel, such as <apex:pageBlockTable>. If you must use these components, set them to one column, using <apex:pageBlockSection columns="1">, instead of the default of two columns.

Avoid wide, non-wrapping components, especially <apex:detail>, <apex:enhancedList>, <apex:listViews>, and <apex:relatedList>, which are all unsupported. Keep device width in mind when creating tables with <apex:dataTable>.

Avoid using <apex:inlineEditSupport>. Inline editing is a user interface pattern that works well for mouse-based desktop apps, but it’s difficult to use on a touch-based device, especially on phones where the screen is small.

Using <apex:inputField> is fine for fields that display as a basic input field, like text, email, and phone numbers, but avoid using it for field types that use an input widget, such as date and lookup fields.

Don’t use <apex:scontrol>. sControls aren’t supported anywhere in the Salesforce app.

PDF rendering, by setting renderAs="PDF" on <apex:page>, isn’t supported for pages in the Salesforce app.