• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

Trouble with IFrame in MS CRM 4.0

I have created an IFrame in a form. It shows the website (internal site) fine but when I type a username and password to login to the site it opens the site in a new window. How do I keep this from happening?
0
varesources
Asked:
varesources
  • 4
  • 4
1 Solution
 
Chinmay PatelEnterprise ArchitectCommented:
Hi varesources,
add <base target="_self"/> in <head> element of your internal site.
Also in CRM's IFRAME : http://www.microsoftcrmhouston.com/customization/Javascript.UsingIframes.html
Check the first image, and uncheck restrict cross-frame scripting on your CRM form.
Regards,
Chinmay

0
 
varesourcesAuthor Commented:
Let me back up a little. Attached is an image that shows where the web address that I want to show up in the IFrame is.

I cannot add the code you provided to the website. It is a 3rd party site created for us. Because each application that is opened has a different web address I need the IFrame to use the address that is in the field.

Thanks!
Untitled-1.jpg
0
 
Chinmay PatelEnterprise ArchitectCommented:
In that case I assume that site is coming from a third party server as well so most probably you will not be able to modify it via JavaScript.
Would you like to give it a shot though? Programatically add <base href="_self"/> tag?
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
varesourcesAuthor Commented:
The site is on a server here in our office. I physically cannot add it.

Here is a tutorial that I found through google. Maybe the information is bad.

To do this, one sets up a little code for the form On Load event that puts the Accounts web site URL into the IFRAME’s URL. It’s actually pretty simple. Here is the code (assumes you already know how to set up an IFRAME). IFRAME_WebSite is the name of the IFRAME and .src references the URL it uses.

// Load web site URL
{
var AccountURL = crmForm.all.websiteurl.DataValue;
if (AccountURL != null)
{
crmForm.all.IFRAME_WebSite.src = AccountURL;
}
}
0
 
Chinmay PatelEnterprise ArchitectCommented:
Yes. I am aware of this code. But your problem is that the window opens up in a new window that is 'cause of Browser behavior. Your script is absolutely fine.
0
 
varesourcesAuthor Commented:
So without editing the html, I am stuck with opening in a new browser? Or is there a option in IE?
0
 
Chinmay PatelEnterprise ArchitectCommented:
First of all as I suggested, try enabling the IFRAME setting, if you do that it might start working as expected, then second choice is to try with adding those base tag using JavaScript.
0
 
varesourcesAuthor Commented:
Correct me if I'm wrong but is WebSite.src the name of the IFrame in the form and AccountURL the name of the field that has the hyperlink?


// Load web site URL
{
var AccountURL = crmForm.all.websiteurl.DataValue;
if (AccountURL != null)
{
crmForm.all.IFRAME_WebSite.src = AccountURL;
}
}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now