0

I have a pretty simple save action in my controller that redirects to record from pageReference but its returning an error Refused to display 'https://cs72.salesforce.com/0015D000009wrmEQAQ' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

here's the controller part...

public PageReference cancelAndRedirect(){

    return retPage(); 
}

public PageReference saveAndRedirect(){     insert callLog;

    return retPage();
}


public PageReference retPage(){
    PageReference retPage = new PageReference('/' + this.retUrl);   
    retPage.setRedirect();  
    return retPage; 
}

<apex:pageBlockButtons location="top">
    <apex:commandButton value="Save" action="{!saveAndRedirect}" reRender="buyerDetailMain" />
    <apex:commandButton value="Cancel" action="{!cancelAndRedirect}" immediate="true"/> 
</apex:pageBlockButtons>

Salesforce for some reason is trying to open the page into an iframe from the same vfpage....

I'm not keen on using javascript to do the redirect as this is quite a direct functionality....or am I missing something?

1
  • I realize it really late...sorry for the post...if the showHeader or showSiderbar is set to true, your page is basically in an iframe...but if both are set to false, you're not in an iframe....so smart salesforce! Feb 13 '18 at 7:35
2

I've experienced this issue before and found that having the Salesforce Developer Mode on was causing the issue.

This can be turned off by navigating to Setup -> Users -> Your User -> Turn Developer Mode off.

1
  • This was the problem for me, thanks!
    – James
    Sep 4 '20 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.