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
LaurenP6777LaurenP6777 

Dashboard within Iframe - Hyperlinks no longer worker since Summer 14 release

Hello, 

Awhile ago, I followed instructed posted on this forum to put a dashboard within an Iframe. The post explained how to add some Jquery code to get the hyperlinks within the dashboard reports to work properly. This was great until the Summer 14 release when we noticed that users could no longer drill down to the dashboard report and click a hyperlink to a specific Opportunity. 

Does anyone know why this code would no longer work? 

<apex:page >

<script src="http://code.jquery.com/jquery-1.9.1.min.js">
jQuery( function ($) {

     $('#iframeID').load( function() {             
         var $frameDoc = this.contentWindow.document,
             urlMatch = /srcUp\(%27(.*)%27\)/;

         $('a[href*="srcUp"]', $frameDoc).each( function () {
             this.href = decodeURIComponent(this.href.match(urlMatch)[1]);
         });
     });

});
</script>

<!-- the rest of your page goes here -->

<iframe id="iframeID" src="/01ZC0000001Okk7?isdtp=vw" scrolling="true" height="100%" width="100%"/>

</apex:page>
@LaceySnr - Matt Lacey@LaceySnr - Matt Lacey

Have you looked at visualforce charts for doing the same kind of thing? There's a big clamp down on the use of iFrames in Salesforce, mostly to do with the security implications involved in using them. The code you've posted does look exactly the like the kind of hack that wouldn't be stable over time as you never know when Salesforce are going to change URL formats etc.

As for the issue, you might need to clarify what you mean by 'not working'!

 

LaurenP6777LaurenP6777
Thank you for your response. I will clarify what the exact issue is.... the dashboard works fine and when a user clicks a dashboard component, they are redirected to the appropriate report. BUT, once they are in the report- if you click a link (lets say an Opportunity Name, for example) they are no longer redirected. An error pops up at the bottom of the screen saying "javascript:srcUp(%27%2F006C000000qmc4y%3Fisdtp%3Dvw%27);" Lauren Hanna Salesforce.com Developer Office (609) 452-4405 Cell (732) 773-2747