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
Nickname7Nickname7 

Console view does not work with Visualforce pages

We have a VF page that is used to override the View for the Account object. When we setup the Console view and open the details of an account, the page is displayed properly. However, when we click on a related object in the account detail (such as Account Cases), then the right side does not show up. Firebug shows the following javascript error:

 

 

Permission denied for <https://namespace.na7.visual.force.com>

to get property Window.srcFromMain from <https://na7.salesforce.com>.
[Break on this error] if (window.parent && window.parent.srcFromMain) {

 

 

This javascript function is in desktopMain.js:

function srcUp(url) {
if (window.parent && window.parent.srcFromMain) {
window.parent.srcFromMain(url);
 } else {
 srcSelf(url);
 }

 

 

 

It seems that the VF page is in a different domain then the frame set and this is causing a security issue with the javascript. Is there a workaround or solution for this issue?

Ispita_NavatarIspita_Navatar

Were you viewing the console and  the account detail page via the same type of user profile of the logged in user?

If no, then in case where you are getting the error for visual force, see if you have added the visual force pages and classes to the profile of that user.

Do let me know if this solves your problem.

Nickname7Nickname7

It is the same profile and this happens with System Administrator as well.

kibitzerkibitzer

Any update on this?

 

I'm seeing the same problem, but only in Firefox, not IE....

telnexttelnext

I have the same problem

I have a visualforce page that replace the new/edit button for opportunity.

In the Console when click on the opportunity this list panel that page is showed (in detail panel of the console).

In the VisualForce page I have then an <apex:outputLink> that should open an emailtemplate  "/email/author/.....".

It works in Google Chrome but no in IE or Firefox. The error is:

 

Access Denied  <https://c.na1.visual.force.com>  trying to get property Window.srcFromMain from <https://na1.salesforce.com>

 

even if in Chrome works (it open the Email template window for the console), I note that the followign warning are shown in the Google Chrome console:

 

Unsafe JavaScript attempt to access frame with URL https://na1.salesforce.com/ui/desktop/DesktopPage from frame with URL https://c.na1.visual.force.com/apex/OpportunityObj?id=0063000000gOU52&isdtp=mn&sfdc.override=1. Domains, protocols and ports must match.

 

How I can solve these problems??

 

BR

Bulent703Bulent703

We were able to work around this issue by providing out VF page as an inline component rather than overriding the edit/view pages. This can work based on what you do in the VF page and the experience is not as good as the override. But console view works.

telnexttelnext

Thanks for your quickly reply.

 

For me could be ok to do not override the new/edit button. But how can manage that when a user click on a record (in my case opportunity) in the list view on the Console it open my visualForce page and not the standard edit page in the detail panel of the Console?

moreover, when I click on the "Create new" it open my visual forse page and not the standard page related to the standard new button?

 

BR 

Bulent703Bulent703

I don't know if that is possible or not, my knowledge seem to end here. But, may be it can give you an idea if I explain what we have done. We took our custom VF page and turned it into an embeddable component by removing the apex:detail tag from it. This just made the VF page display only our custom component. Then, we prepared a custom page layout and embedded our VF page in this layout by dragging it into the page. This allows our component to load other items within the iframe versus trying to open it in the console views main frame and getting the javascript errors.

 

Hope this helps...

telnexttelnext

I don't know if this can help you, but I solved all my problem using in my VF page the

 

<apex:commandLink

 

and not the

 

<apex:outputlink

 

the apex commandLink call a method in my controller that return the Pagerefence of the page I want switch to intothe console detail panel.

No javascript function is called here (dektopmain.js and srcUp).

Otherwise using the

 

<apex:outputlink

 

the js funnction srcUp is called and this  doesn't work!

 

BR

LakshmanLakshman

Hi All,

 

i am also facing the same issue. I have a Case and I have over rided the view button of Case. But when I open any case in Console the right most side bar is missing which has Contact related information.

When I check the error console it shows Permission denied kind of error.

Is there any work around to this as I want to make my inline visual force links page work in the console and also want to view the sidebars.

 

Regards,

Lakshman

nagalakshminagalakshmi

Hi,

 

I am also facing the same issue. I have a custom object. i am override the 'view' link with visual force page. In my visual force page i have a  command link. when i click on the command link it shows the list of child records. It is worked properly in google chrome and mozilla firefox. But in IE it is not working. when i click on the command link its just refresh the screen it does not open the child records panel. Please help me out how to solve this.

 

Thanks,

Lakshmi

HariPHariP

Hi,

 

If you are still looking for solution. I just did this and it worked perfectly as I wanted:

 

include service console integrations js:

<apex:includeScript value="/support/console/26.0/integration.js"/>

 

my custom JS method:

 

function openPrimaryTab(id, name) {
 if (sforce.console.isInConsole())
  sforce.console.openPrimaryTab(undefined, '/' + id + '?isdtp=vw', true, name);
 else
  window.top.location.href = '/' + id;
}

 

Hyperlink in code to call above JS method (you can replace with apex:outputlink here)

<a href="#" onclick="openPrimaryTab('{!obj.Id}', '{!obj.Name}'); return false;">{!obj.Name}</a>

 

Thanks

Hari

Mogul KhanMogul Khan

Can somebody please suggest a work around for the issue.!!!!

 

As there is no solution for this here yet, I suppose this is an issue with Salesforce. Can somebody tell me how to bring this to salesforce's notice so that it can be fixed.

Mogul KhanMogul Khan

Not working.

 

there is no js method in my vf...only one line

 

 

<apex:page standardController="Lead" extensions="LeadExtension" action="{!init}">
<apex:form > <apex:detail subject="{!lead.id}" inlineEdit="true"/> </apex:form>
MagnetismMagnetism
insert below code in the overriding visualforce page and try. I worked this out today. Works great for me.


<apex:includeScript value="/support/console/37.0/integration.js"/>
    <script type="text/javascript">
    var accId = '{!account.ID}';
    if (sforce.console.isInConsole()) 
    {
        window.location.href = '/' + accId + '?nooverride=1&isdtp=mn'; 
    } 
    </script>