• Rocky Josan
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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