Solved

Trouble with IFrame in MS CRM 4.0

Posted on 2010-08-19
8
662 Views
Last Modified: 2013-11-24
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
Comment
Question by:varesources
[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
  • 4
  • 4
8 Comments
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 500 total points
ID: 33479402
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
 
LVL 1

Author Comment

by:varesources
ID: 33479543
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
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 33479583
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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
LVL 1

Author Comment

by:varesources
ID: 33479632
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
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 33479652
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
 
LVL 1

Author Comment

by:varesources
ID: 33479664
So without editing the html, I am stuck with opening in a new browser? Or is there a option in IE?
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 33479680
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
 
LVL 1

Author Comment

by:varesources
ID: 33480072
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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