You need to sign in to do that
Don't have an account?

including visualforce page in detail layout
Anyone know why I have suddenly lost the ability to include a VF page in one of my sections on a custom object page layout? It used to be there as recently as a few weeks ago and now I only see Scontrols, related lists, custom links, and fields for my object, no more "Pages".
Please advise...
Thanks
Please advise...
Thanks
I wasn't sure how to make the function actually run when the page/frame was loaded - can't figure out how to set the 'onload' attribute of the 'body' element like I could in a regular HTML page (can that be done with a visual force page?)
What've done is to use the syntax
All Answers
I asked the same thing of one of the VF core developers at the Dreamforce conference in London just recently. Simple answer - you cannot do this now with the summer 2008 release except by 'including' your VF page within an S-Control (type = url...)
You can then include a bit of javascript which dynamically resizes your scontrol in your vf page - so it works reasonably well...
Apparently the functionality you (and I) want is in the roadmap.
Is there an example or explanation anywhere of how to do this?
Here's a bit of javascript I use to dynamically change the size of the S-Control... very useful...
function resizeIframe() {
var thisWindow = window.name;
if(thisWindow){
var iframes = parent.document.getElementsByName(thisWindow);
if (iframes && iframes.length == 1) {
var height = document.body.scrollHeight;
iframes[0].style.height = height + "px";
}
}
}
Message Edited by London Ben on 07-24-2008 01:11 AM
I'll give that a try.
I wasn't sure how to make the function actually run when the page/frame was loaded - can't figure out how to set the 'onload' attribute of the 'body' element like I could in a regular HTML page (can that be done with a visual force page?)
What've done is to use the syntax
I've not 'tested' your code - but you are going about it exactly the right way with window.onload (to my best knowledge anyhow)
I probably should have mentioned this when I posted the example script - but well done for figuring it out...
Anyway, it appears that the ability to add a Visual Force page to a Page Layout has now been restored. Does anyone know what's happening/happened here?
John
To me, it seems like the Pages selection in the page layout is only available when you use a standardController in your visualforce page (same with overriding standard buttons). Anyone know if this is a Developer Edition only feature?
Message Edited by XactiumBen on 08-05-2008 08:17 AM
You CAN include a VF page in a 'page layout' so long as the standard controller is used (so if you use standardController="Account" then you may add this VF page to an Account Page Layout...
What you will find - is that despite your cleverness in achieving this - it's just being embedded in an Scontrol effectively anyway... ie. the size of the 'frame' is subject to the same conditions as an sControl - and you user will experience the 'VF' page being loaded after the main page (same as an Scontrol)...
SO - big deal... just put whatever page you like inside an sControl - use whatever 'controller' you like then... functionality is the same (ie. not perfect - but ok)
As I stated originally - proper support for VF pages in page layouts is some point in the future - from the mouth of the one of the VF lead developers (at dreamforce london 08)
I see there is a reference in S-Controls to a visualforce page.
{!$ObjectType.ApexPage}
But how do I set that to a specific page?
{!$ObjectType.ApexPage}="test"; didn't work (where my visualforce page name is "test")
Any help is appreciated.
in my case I just created a 1-line S-Control of type 'URL' containing the relative address of the Visual Force page plus the Id of the Account:
where 'SFA_KeyDecisionMakers' is the name of my Visual Force page.
The effect of this seems to be that a window (iFrame?) is created within the page layout and that window shows the Visual Force page.
Regards
John
That's exactly what I mean...
The effect is the same as including a visual force page directly in a page layout (standard controller)...
Seems at the moment it's pretty half-baked - but it works.
With the inclusion of the bit of javascript earlier - you can dynamically resize the 'frame' so as it fits to content rather than the predetermined size (which I usually set to 1px so as it looks a little smoother visually as the 'page' is loading)
yes, I have your Javascript code in my VF page.
Oddly, I'm finding that the ability to add a Visual Force directly to a page layout (rather than wrapping it in an S-Control) seems to have been switched off again - although the VF Page I'd already included a few weeks ago still seems to be working.
Regards
John
pmb
Hi folks
The JavaScript code that was presented earlier works so long as the S-Control is not encapsulated in a collapsed section. When it's in a collapsed section the height of the control is 0 pixels.
To counter this I've changed the properties of the section so that it's about tall enough to accomodate the S-Control; I've added scroll bars; and I've added the following condition to the middle of the script:
var height = document.body.scrollHeight;
if (height > 10)
{
iframes[0].style.height = height + "px";
}
Note that this JavaScript only works for S-Controls. VisualForce pages have a slightly different security model, and the outer information isn't available to the code.
Paul
Hi,
I am getting "Access is denied" error for the following line.
Pleaes help!
Hi jmasl7x,