+ Start a Discussion
sftechlearnersftechlearner 

Apex page

I have linked an URL of a dashboard in an apex page.

 

<apex:page >
<apex:outputLink value="https://na9.salesforce.com/01Z80000000zKfc" target="_self">Service dashboard</apex:outputLink><br/>

</apex:page>

 

and created a visualforce tab for this apex page. so when the tab is clicked i would like to open this dahsboard in a new page automatically with out clicking any link.

 

But when i click the tab this is taking to the dashboard URL only on clicking the Link Text "Service Dashboard". How do link the page with out the linktext so if the tab is clicked it automatically opens the dahsboard in a new page.

 

Thanks!!

sfdcfoxsfdcfox
The page will still load, regardless (the tab would have no content if it did not include any other content), but if you wanted the Service dashboard to appear in a new window, you'd use JavaScript's window.open function using a page onload event or inline script element.
sftechlearnersftechlearner

When i give target="_blank" it opens in the new page. But i don't want to click this link text to go to dashboard.

sfdcfoxsfdcfox

Use something like:

 

<script>
window.open('https://na9.salesforce.com/01Z80000000zKfc')
</script>

 

sftechlearnersftechlearner

I tried this, but when I click the tab for dashboard now it doesn't pull anything now. just says popup blocked.

Please advise!!!

sftechlearnersftechlearner
<apex:page >
<html>
<body>
 <script type='text/javascript'> window.open('https://na9.salesforce.com/01Z80000000zKfc',target="_blank")</script>
 window.focus()
</body>
 </html>
</apex:page>
sftechlearnersftechlearner

I tried this code . But it doesn't work.

 

<apex:page >
   
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/11.1/connection.js"></script>
    <script language="javascript">
      function LoadPage()
      {
        window.open("https://na9.salesforce.com/01Z80000000zKfc",target="_blank");
       }
    
    </script>
  <apex:pageblock >
  <apex:form >
  
  <body onload="LoadPage()">
  </body>
  </apex:form>
  </apex:pageblock>
  </apex:page>