function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bsil bsilbsil bsil 

visualforce page issue in salesforce1

Hi,

I have displayed visualforce page in standard page layout
as shown in the below screen
User-added image
i have displayed two links in visualforce page.

when i click on like it gets open new window. it is working fine in desk top application.

 
coming to salesforce1

it's taking two steps to open link like below screens

User-added image

visualforce code:

<apex:page standardController="task" extensions="SurveyandStepsController" docType="html-5.0">
    <apex:form >
        <script>
            function navigate(){
                var proid = '{!prosteps.id}';
                var tasid1 = '{!taskId}';
                var steUrl = '/apex/StepsAttachmentShow?id='+proid+'&taskid='+tasid1;
                 if( (typeof sforce != 'undefined') && (sforce != null) ) {
                  // Salesforce1 navigation
                  sforce.one.navigateToURL(steUrl);
                } 
                else {
                  window.open(steUrl);
                }
                
            }
        
        function navigatesurvey(){
                var surveyid = '{!surveyid.id}';
                var accid = '{!correnttask.Whatid}';
                var tasid = '{!taskId}';
                var surveyUrl = '/apex/TakeSurvey?id='+surveyid+'&Accname='+accid+'&taskid='+tasid;         
                 if( (typeof sforce != 'undefined') && (sforce != null) ) {
                  // Salesforce1 navigation
                  sforce.one.navigateToURL(surveyUrl);
                } 
                else {
                  window.open(surveyUrl);
                }
                
            }
        </script>        
            <div >
                <br/>            
                <div style="height:100%;width:50%;float:left;">
                    <b><apex:commandLink onclick="navigatesurvey();return false;" value="Click here for Survey" rendered="{!surveyid != null }"/></b>
                </div>
                <div style="height:100%;width:50%;float:right;">
                    <b> <apex:commandLink onclick="navigate();return false;" value="Click here for Steps" rendered="{!prosteps != null }"/></b>
                </div>
                
            </div>           
  
   </apex:form>
   
</apex:page>

I am new to salesforce1

can anyone knows kingly suggest me how to implement


Thanks in advance

 
SonamSonam (Salesforce Developers) 
Is this same behavior shown on the browser version of Salesforce1: please go to : na1.salesforce.com/one/one.app and login and see if you are able to repro the same on the detail page ..
bsil bsilbsil bsil
i test in salesforce1 using one/one.app.

here also am getting same problem.

in borwser i am not getting any issue.

it's only problem in salesforce1

thanks for ur response...!
SonamSonam (Salesforce Developers) 
Thanks for checking this..I also tested the same on my mobile SF app and it has the same behavior.

I checked this in-house and seems this is WAD - following is suggested as a consideration when implementing vf pages with SF1 app:

** You can also add inline Visualforce pages to a record detail page layout. Pages added this way don’t need to
be enabled for mobile use, but do consider how the page will appear when it displays on a mobile device. In general,
Visualforce added to page layouts works best if it’s read-only, at-a-glance information.

A possible workaround would be to use custom links instead of having a separate page with these two links.

You can create 2 custom links on the detail page which point to the pages you wish to open..

 
Rocky JosanRocky Josan
Hi!!

Any update on the issue? 

I am also facing a similar situation.
Please help.

Thanks!!