You need to sign in to do that
Don't have an account?
Michael_Torchedlo
Salesforce1 mobile navigation, sforce.one not working
I've been reading through the documentation about using the sforce.one javascript library but I can't seem to get a simple hyperlink or output link to properly work in Salesforce1. If anyone in the community can please clarify where my error is, it is much appreciated.
The page renders properly in the mobile app, but the links do nothing (no error message, no screen change).
As a novice, I thought it may be just a syntax problem, so I tried several variations below.
The page renders properly in the mobile app, but the links do nothing (no error message, no screen change).
As a novice, I thought it may be just a syntax problem, so I tried several variations below.
<apex:page docType="html-5.0" showheader="false" sidebar="false" > <div style="width:100%;" > <apex:form rendered="true" id="theform" > <apex:outputLink value="javascript:sforce.one.navigateToSObject(001e000000Ysn5I);" > <apex:outputText value="LINK 1" /> </apex:outputLink><br/><br/> <apex:outputLink value="javascript:sforce.one.navigateToSObject('001e000000Ysn5I');" > <apex:outputText value="LINK 2" /> </apex:outputLink><br/><br/> <apex:outputLink value="javascript:sforce.one.navigateToURL('/001e000000Ysn5I');" > <apex:outputText value="LINK 3" /> </apex:outputLink><br/><br/> <apex:outputLink value="javascript:sforce.one.navigateToURL(/001e000000Ysn5I);" > <apex:outputText value="LINK 4" /> </apex:outputLink><br/><br/> </apex:form> </div> </apex:page>
All Answers
I had used <apex:commandButton onclick="window.location='/apex/pagename';return false;" /> to navigate to the page in the first place. This renders inside within Salesforce1 app window, but apparently it does not open the page using the Salesforce1 app browser, so it was reading the page as though it was opening in full browser (no SF1 functions).
http://bobbuzzard.blogspot.co.uk/2014/01/visualforce-in-salesforce1.html