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
Siddharth PrakashSiddharth Prakash 

Emebedded dashbaord page does not work , it opens up a dashboard list

Hi team,

Before Spring 15 , my dashboard was getting embedded properly in salesforce user homepage. But, now i am getting a page that opens up into the dashboard page and is not a part of the home page any more ???? Is there some new change with respect to iframe.

Please advise urgently.

I have the following visualforce page:

<apex:page sidebar="true" showHeader="true">
<!--Hello {!$User.FirstName} {!$User.LastName} {!$UserRole.Name}-->
<iframe id="myFrame" height="100%" width="100%" frameborder = "no" scrolling = "no"></iframe>
        <script type = "text/javascript">
            var sw = "{!$UserRole.Name}"
            var iframe = document.getElementById('myFrame'); 
            
            if (condition1) {
                iframe.src = "/01Z40000000MXOu?isdtp=mn";
            }
            
            else if (condition2") {
                iframe.src = "/01Z40000000MXQR?isdtp=mn"; 
            }
            
            else if (condition3) {
                iframe.src = "/01Z40000000MXOu?isdtp=mn"; 
            }
            
            else if (condition4) {
                iframe.src = "/01Z40000000MXOp?isdtp=mn"; 
            }
             
            else if (condition5) {
                iframe.src = "/01Z40000000MXOk?isdtp=mn"; 
            } 
                        
        </script>
</apex:page>
Gaurav KheterpalGaurav Kheterpal
This is actually a known issue in Spring15 and is discussed here (https://success.salesforce.com/issues_view?id=a1p300000008XttAAE) in detail. You can implement the following workaround

You must load the content within it's serving domain, for example:
You can have a link to the report/dashboard to open in a new window or the current document by using the target attribute within the <apex:commandLink> component or <a> tag

I hope this helps.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Developer Forums Moderator| Dreamforce Speaker



 
Siddharth PrakashSiddharth Prakash
Hi Gaurav,

Could you please elaborate on this ? I know i can embed a link - which will open to a different tab/new page.
My current requirement is that it should load on that homepage. This is required so that my sales leads can see what is pending where without having to browse through the dashboards.

Any pointers will be helpful.

Regards
Siddharth
Gaurav KheterpalGaurav Kheterpal
There is a workaround listed here (http://salesforce.stackexchange.com/questions/38918/end-of-javascript-sidebar-workarounds), see if this works for you.

If my answer helps resolve your query, please mark it as the 'Best Answer' and upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker


 
Siddharth PrakashSiddharth Prakash
Hi Gaurav,

We were able to solve this by using self.location.href ="complete URL" in the javascript and have been able to render the dashboards the home page. Thanks for your help though.

Regards
Siddharth
Gaurav KheterpalGaurav Kheterpal
Thanks, good to know that it's fixed.
subbareddysubbareddy
Hi Siddharth,

I too have same problem, would you mind sharing your code with us?

Thanks,
Venkat
Siddharth PrakashSiddharth Prakash
Shared @ https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AyTq
John Burke 22John Burke 22
Hi Siddharth and everyone -- 

This workaround no longer seems to work.  Every variation I try on 
<apex:page showheader="true" sidebar="true">
<apex:outputPanel >
<script>
location.href="(the url)" 
</script>
</apex:outputPanel>
</apex:page>

does the same thing: take me from the home page to the dashboard page instead of popping the dashboard page inside the home page component.  I have tried with apex:iframe; I have tried it using apex:outputPanel instead of iframe (as shown here); I ahve tried without outputpanel and just the script; I have tried with and without the "vw" instructions at the end of the URL.  

Is there any way to get the dashboard page to show up in a scrollable dashboard component any more?

Thanks,

John