iframe to standard salesforce page

  • 2
  • Problem
  • Updated 2 years ago
  • Solved
  • (Edited)
I can't for the life of me get a standard salesforce page to show up in a template via iframe. ie. a task standard page in a template. Even if copy paste the url of the task into the src like so.

<iframe src="https://mblazonry.my.salesforce.com/00Tj0000004wkMB" />

What am I missing?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 43,056 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,016 Points 5k badge 2x thumb
Maybe SAMEORIGIN problem?  Open Dev Tools and check the error.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 43,056 Points 20k badge 2x thumb
There it is. SAMEORIGIN. Never seen this before.  Do you know of a way to manage this?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,508 Points 20k badge 2x thumb
FWIW.  We have never been able to get standard layouts to appear in Skuid pages.  I can't say we've done everything possible.  But we've never been successful. 

Sorry. 
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,016 Points 5k badge 2x thumb
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,016 Points 5k badge 2x thumb
Official Response
More information:

Salesforce enabled Clickjack protection on setup and non-setup pages by default in Spring '14.  To Salesforce, iframes are not secure.  You may try contacting Salesforce support and see if they can disable it for you.

You can see Clickjack Protection settings at Setup > Administration Setup > Security Controls > Session Settings.
Photo of Zach McElrath

Zach McElrath, Employee

  • 50,794 Points 50k badge 2x thumb
Irwin nailed it! Salesforce's Clickjack Protection prevents any standard Salesforce page from being used in an iFrame, and I believe that as of a more recent release they made it impossible to disable this from the Session Settings panel without contacting Salesforce support directly.
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,644 Points 4k badge 2x thumb
You could accomplish this by creating a visualforce of the standard page layout like so:

<apex:page standardController="Task" sidebar="false" showHeader="false">   <apex:detail relatedList="false" title="false" inlineEdit="true"/> 
</apex:page>
and then putting the visualforce in an iframe. By default, the page will take the task id from an "id" url parameter. You might need to mess around a bit with the visualforce page though. For instance, some of the buttons don't work as expected out of the box.