3

I have created a visualforce page that is essentially a button that will be placed on a Contact's page. When pushed it will redirect the user to another visualforce page and carry along the contact id. I have added this visualforce page to the mobile card section of the corresponding layout. Here is what it looks like from the salesforce1 emulator enter image description here

The problem that I am facing is that when I try to click the button it takes me to a brand new page with just the button where I have to click it again in order for it to redirect.

enter image description here

Here is the code for the button

<apex:page docType="html-5.0" showHeader="false" sidebar="false" standardController="Contact">
  <apex:outputLink styleClass="btn" value="{!URLFOR($Page.MobileContactContactAddRelationship, contact.id)}">
    <apex:outputText value="Create Relationship"/>
  </apex:outputLink>
</apex:page>

So does anyone know why the button will go to a new page where I have to reclick it?

  • 1
    Same issue i'm facing. I assume this is the default behavior of mobile enabled visualforce pages. – Prasad Jan 28 '15 at 4:32
  • Yeah it seems to be the default behavior for mobile cards. I ended up going with a publisher action to make the UI better – Louis Pujol Jan 29 '15 at 16:53
1

This is the default behavior of the Mobile Cards, where the Mobile Card simply shows a preview of the Visualforce page. Once clicked, you are redirected to the full Visualforce page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.