Skip to main content

Code reviews rule: Visualforce Tags not supported by Salesforce1

Written by David Martin
Updated this week

Visualforce Tags not supported by Salesforce1

Why is this an issue?

The Salesforce mobile app does not support all Visualforce components. When your Visualforce page or component uses an unsupported tag, it will either fail to render or display incorrectly on mobile devices. This leads to a broken user experience for anyone accessing the page through the Salesforce mobile app.

The following tags are not supported in the Salesforce mobile app:

  • apex:detail

  • apex:enhancedList

  • apex:listViews

  • apex:inlineEditSupport

  • apex:scontrol

  • analytics:reportChart

  • apex:emailPublisher

  • apex:flash

  • apex:logCallPublisher

  • apex:relatedList

  • apex:sectionHeader

  • apex:selectList

  • apex:tabPanel

  • apex:tab

  • apex:vote

Examples

Example of incorrect code:

<apex:page>
<apex:detail subject="{!account.Id}" relatedList="false" />
</apex:page>
<apex:page>
<apex:tabPanel>
<apex:tab label="Tab One">
<apex:relatedList list="Contacts" />
</apex:tab>
</apex:tabPanel>
</apex:page>

Example of correct code:

<apex:page>
<apex:form>
<apex:inputField value="{!Account.Name}" />
<apex:commandButton value="Save" action="{!save}" />
</apex:form>
</apex:page>
<apex:page>
<apex:pageBlock title="My Block">
<apex:pageBlockSection title="Section">
<apex:outputText value="Hello World" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

How can I fix violations?

Replace the unsupported tag with an alternative compatible with the Salesforce mobile app. For example:

  1. Replace apex:detail with a custom layout using apex:outputField or apex:pageBlock components.

  2. Replace apex:enhancedList and apex:listViews with custom list implementations using apex:pageBlockTable or apex:dataTable.

  3. Replace apex:tabPanel and apex:tab with a custom tabbed interface or restructure your page to avoid tabs.

  4. Replace apex:relatedList with a custom SOQL query and apex:pageBlockTable to display related records.

  5. Remove apex:flash and apex:scontrol entirely, as they rely on technologies (Flash, S-Controls) that are deprecated.

If compatibility with the Salesforce mobile app is not required for a given page, you can dismiss the issue for that page.

When should I disable this rule?

You may want to dismiss this issue if your Visualforce page is only used in the Salesforce desktop experience and will never be accessed through the Salesforce mobile app. If you are certain the page is not exposed to mobile users, the unsupported tags will not cause any issues.

Resources

Did this answer your question?