You need to sign in to do that
Don't have an account?
Nikhil_Khetan
Inline VisualForce in Salesforce1 Object Detail page
Hi Guys,
I am facing a starnge behaviour of inline VisaulForce on my deatil page of contact in Salesforce1.
I have 3 buttons on my visualforce(Nothing else on page), now i have added this visualforce on my contact page layout. This works fine when i run this on web browsers, but when i see it on my mobile device the page looks good but when i click on button the complete visaulforce page gets open again with only this 3 buttons on page and then i can click on those button which redirects me to some othe page.
Is it possible to make those button clickable same at inline visualforce itself(instead of opening same page again).
Below is code of the Page:
<apex:page docType="html-5.0" standardController="Contact" showHeader="false" sidebar="false" standardStylesheets="false">
<script>
function test1(){
if ( (typeof window.sforce != 'undefined') && (window.sforce!=null) ) {
sforce.one.navigateToURL('/apex/XXXXX?ConId={!Contact.Id}&retURL=/{!Contact.Id}');
}
else {
alert('Not in SF1 :(');
}
}
function test2(){
}
function test3(){
}
</script>
<apex:form >
<apex:commandButton styleClass="sf1button" value="Add" onclick="test1()" />
<apex:commandButton styleClass="sf1button" value="New" onclick="test2()"/>
<apex:commandButton styleClass="sf1button" onclick="test3()" value="View"/>
</apex:form>
</apex:page>
I am facing a starnge behaviour of inline VisaulForce on my deatil page of contact in Salesforce1.
I have 3 buttons on my visualforce(Nothing else on page), now i have added this visualforce on my contact page layout. This works fine when i run this on web browsers, but when i see it on my mobile device the page looks good but when i click on button the complete visaulforce page gets open again with only this 3 buttons on page and then i can click on those button which redirects me to some othe page.
Is it possible to make those button clickable same at inline visualforce itself(instead of opening same page again).
Below is code of the Page:
<apex:page docType="html-5.0" standardController="Contact" showHeader="false" sidebar="false" standardStylesheets="false">
<script>
function test1(){
if ( (typeof window.sforce != 'undefined') && (window.sforce!=null) ) {
sforce.one.navigateToURL('/apex/XXXXX?ConId={!Contact.Id}&retURL=/{!Contact.Id}');
}
else {
alert('Not in SF1 :(');
}
}
function test2(){
}
function test3(){
}
</script>
<apex:form >
<apex:commandButton styleClass="sf1button" value="Add" onclick="test1()" />
<apex:commandButton styleClass="sf1button" value="New" onclick="test2()"/>
<apex:commandButton styleClass="sf1button" onclick="test3()" value="View"/>
</apex:form>
</apex:page>
All Answers