Solved

How can I modify the IFRAME settings (width) in CRM 4.0

Posted on 2011-03-10
10
1,336 Views
Last Modified: 2012-10-25
Hi all,
I have a CRM form with an IFRAME. I put a code on a field (on change); if this field is 1 i display a site in the IFRAME; if this site is 2 i display an other site on intranet.

But I want that this site in IFRAME has a width of 70% or alternatively so that this site will be adapted in the IFRAME (with no bar under the page).
How can i do this?

I past the code; I see that never enter in the else and I obtain an error.

Many thanks
Mark
// Waits for the content window of the IFrame to be ready
  function FixStylingInFrameSource(iframeID) {
      // Check the content window's ready state
      if (document.getElementById(iframeID).contentWindow.document.readyState
!= "complete") {
          // Re-run this function in 10 ticks
          window.setTimeout(function() { FixStylingInFrameSource(iframeID) }, 10);
      }
      // Content window is ready
      else {
          // Change the background color
          document.getElementById(iframeID).contentWindow.document.body.style.backgroundColor = "#eef0f6";
          // Remove the left border
          document.getElementById(iframeID).contentWindow.document.body.all(0).style.borderLeftStyle = "none";
          // Remove padding
          document.getElementById(iframeID).contentWindow.document.body.all(0).all(0).all(0).all(0).style.padding = "0px";

          // Make the cell the full width of the IFRAME
         document.getElementById(iframeID).contentWindow.document.body.all(0).style.width = "102%"

          // Show the IFrame
          document.getElementById(iframeID).style.display = "block";
      }
  }


if(crmForm.all.new_site.DataValue == 1)
{
  crmForm.all.IFRAME_site.src = "http://www.google.it";
  FixStylingInFrameSource('IFRAME_site');
}
else
{
  crmForm.all.IFRAME_site.src = "http://www.google.it";
  FixStylingInFrameSource('IFRAME_site');

}

Open in new window

0
Comment
Question by:helpdeskscm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 

Author Comment

by:helpdeskscm
ID: 35109823
I explain the problem little better. I have an IFRAME on my CRM FORM.
The URL of that IFRAME is one site in the intranet. Normally in Intranet when I click to this site , this authenticate the user and open a new windows (in full screen).

So when i put the url of this site in the IFRAME this load the second page in the IFRAME (based on authenticated user) but this page expanded in full screen; so in the Iframe I can't see the CRM fields and no scroll navigation bar.

How can I resolve? Can I resize this second page in the IFRAME border?

Or what can I do to resolve this problem?

Many thanks
Mark
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 35126609
Hi Mark,

Check out the attached image. Click on the iframe and then properties to get to this dialog. You can control the size by providing number of rows and so on.


Regards,
Chinmay

iframe.png
0
 

Author Comment

by:helpdeskscm
ID: 35129856
yes i put 10 Number of rows but....the problem is that the web site opens in full screen mode (because it is an option of the site)!

I can't change this option in the web page...........and when the iframe loads hides the other fields on the form!!

what can i do?A resize of the iframe after the page has loaded?

any ideas?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 35133637
If the other site is opening up in a new window then it is difficult. I thought it is somehow increasing the size of the IFRAME but as I understand from your reply it is opening up an entire new window... in that case, you might wanna call window.focus() on the CRM form after your intranet site is loaded.
0
 

Author Comment

by:helpdeskscm
ID: 35139072
I try with window.focus() but I see my IFRAME (out of borders) and under the IFRAME the mouse cursor is focused on the 1° field but.....my IFRAME covers all crm fields.

I past the code that I have in the onload event of my form. When the IFRAME has loaded what can I do? Can i resize it in the borders? Or other ideas?
Can i resize the width and the height? The IFRAME is so big that i can't see the left scroll bar and the scroll bar under tha page....How can i see it in my IFRAME?

Thank you very much!

var iFrame = crmForm.all.IFRAME_new;
iFrame.attachEvent( "onreadystatechange" , Ready);

function Ready()
{  
    alert("change_state");

if (iFrame.readyState == "complete") {
alert("state_complete");

document.getElementById('IFRAME_new').width= "10%";
document.all.crmNavBar.parentElement.style.display = "none";
document.all.tdAreas.colSpan = 2;
window.focus() ;

}

}
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 35161848
try setting the width to 100 or something and let's see also please upload a screenshot if possible.
0
 

Author Comment

by:helpdeskscm
ID: 35187582
I upload the screenshot. You can see the CRM Form. When it loads the IFRAME (in red) opens in full screen in the form and it covers the other fiels on the form (in green). I tried to change the width to any values but does not work.........




 crm form
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 35188423
alright... do we have control over the code of the iframe in red?
0
 

Author Comment

by:helpdeskscm
ID: 35189479
no....because is an application of a third part and I can not modify the code.....
I can only know when the IFRAME become ready....

var iFrame = crmForm.all.IFRAME_new;
iFrame.attachEvent( "onreadystatechange" , Ready);

function Ready()
{  
    alert("change_state");

if (iFrame.readyState == "complete") {
alert("state_complete");

document.getElementById('IFRAME_new').width= "10%";
document.all.crmNavBar.parentElement.style.display = "none";
document.all.tdAreas.colSpan = 2;
window.focus() ;

}

}

I suppose that i can resize the IFRAME width and height in the borders after the IFRAME is load.....

But I don't know how to do this.....

Any ideas?
0
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 500 total points
ID: 35232855
Sorry for the delay, I lost track of your question.

Try this link : http://www.wolfcreekconsulting.com/support/techlib/web/DynamicallyResizedIframesPart2.php

Regards,
Chinmay.
0

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part I
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question