Sunday, December 19, 2010

Put a View in a form and on select of that record load the same to the Form in another Iframe

Its very frequent requirement.
like i want to put a view to the forma and on select(double click) it should load also to the same form(another iframe).

So just follow the following steps.
make sure the IFRAME names. change as per yours.

//put the two iframes and load the record on double cick of the record from one Iframe

//get the server url with port (if anything else 80) u can not really rely ;)
function getServerUrlWithPort()
return window.location.protocol + "//" + ;

//this is for the
function OnGridViewReady()

var gridview = document.all.IFRAME_Grid;
if( gridview.readyState != 'complete' )
gridview.contentWindow.document.getElementById('crmGrid_JumpBar') = 'none';
gridview.contentWindow.document.getElementById("quickFindContainer") = "none";

gridview.contentWindow.document.getElementById("crmMenuBar") = 'none';

var gridviewDocument = gridview.document.frames["IFRAME_Grid"].document;
var gridviewWindow = gridviewDocument.parentWindow; = OnWindowOpen;
gridviewDocument.body.scroll = "no";

//this will bind the url to the 2nd IFrame instead of opening it as new window
function OnWindowOpen( url )
var formview = document.all.IFRAME_Form;
//alert("aaaa"+url+"#######"+formview );
formview.src = getServerUrlWithPort() + url;

if (url != "/" + this.parent.ORG_UNIQUE_NAME + "/sfa/accts/edit.aspx")
return false;

//this will be fired when the form will be loaded to the 2nd IFrame
//hide the left nav area and other menu items also
function OnFormViewReady()
var formview = document.all.IFRAME_Form;

if( formview.readyState != 'complete' )

formview.document.frames['IFRAME_Form'] = "1px solid #6893cf";

if (formview.contentWindow.document.getElementById('leftNavBreadcrumbImg') == null)
formview.contentWindow.document.getElementById('leftNavBreadcrumbImg') = 'none';
formview.contentWindow.document.getElementById('leftNavBreadcrumbImg').parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.height = '45';

formview.contentWindow.document.getElementById('crmMenuBar') = 'none';
formview.contentWindow.document.getElementById('crmNavBar') = 'none';
formview.contentWindow.document.getElementById('tdAreas').colSpan = 2;
formview.contentWindow.document.getElementById('crmRenderStatus') = 'none';
formview.contentWindow.document.getElementById('help') = 'none';


var Grid = crmForm.all.IFRAME_Grid;
var Form = crmForm.all.IFRAME_Form;

//hide tab"none";

document.getElementById('help').style.display = "none";
document.getElementById('mnuDown').style.display = "none";
if(document.getElementById('navAsyncOperations') !=null)


No comments:

Post a Comment