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
jhonnajhonna 

displaying Visual force page inside a page layout

How do I display any Visual force pages inside a page layout?? Is it possible?

Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

Guys I had make it possible just by simple Javascript

 

Let me know how is this Approach :)

 

 

here is complete solution for you... :)

 

Create custom button , Detail page button with content source as Javascript

 

Here is code for your script

 

 

var url="http://www.xxx.com/assests?id={!Account.Id}";
var a = [];var re = new RegExp('\\bpbHeader\\b');var els = document.getElementsByTagName("div");for(var i=0,j=els.length; i<j; i++)if(re.test(els[i].className))a.push(els[i]);var parent=a[0];
var e=document.getElementById("FrameLoader");
if(e==null)
{
var Errordiv = document.createElement('div');
Errordiv.setAttribute('id','FrameLoader');
Errordiv.setAttribute('title','Download complete');
Errordiv.innerHTML = '<p><span class="ui-icon-circle-check ui-icon" style="float:left; margin:0 7px 50px 0;"></span>Assets Details  </p>';
parent.appendChild(Errordiv); 
var con=document.getElementById("FrameLoader");
var ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", url);
ifrm.setAttribute("frameBorder",0);
ifrm.style.width = 700+"px";
ifrm.style.height = 250+"px";
con.appendChild(ifrm); 
}

 

 

Special request Dont Play With Script Code ,

*** Just update your destination url..... :)

 

 

Cheers,

Bala 

All Answers

GoldwinGoldwin

HI,

 

Yes, its possible using the page layout, you can select and include the VF pages from the palette.  like this example

b-Forceb-Force

Guys I had make it possible just by simple Javascript

 

Let me know how is this Approach :)

 

 

here is complete solution for you... :)

 

Create custom button , Detail page button with content source as Javascript

 

Here is code for your script

 

 

var url="http://www.xxx.com/assests?id={!Account.Id}";
var a = [];var re = new RegExp('\\bpbHeader\\b');var els = document.getElementsByTagName("div");for(var i=0,j=els.length; i<j; i++)if(re.test(els[i].className))a.push(els[i]);var parent=a[0];
var e=document.getElementById("FrameLoader");
if(e==null)
{
var Errordiv = document.createElement('div');
Errordiv.setAttribute('id','FrameLoader');
Errordiv.setAttribute('title','Download complete');
Errordiv.innerHTML = '<p><span class="ui-icon-circle-check ui-icon" style="float:left; margin:0 7px 50px 0;"></span>Assets Details  </p>';
parent.appendChild(Errordiv); 
var con=document.getElementById("FrameLoader");
var ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", url);
ifrm.setAttribute("frameBorder",0);
ifrm.style.width = 700+"px";
ifrm.style.height = 250+"px";
con.appendChild(ifrm); 
}

 

 

Special request Dont Play With Script Code ,

*** Just update your destination url..... :)

 

 

Cheers,

Bala 

This was selected as the best answer
jhonnajhonna

Thanks Bala. Appreciate it