Solved

Trouble with IFrame in MS CRM 4.0

Posted on 2010-08-19
8
660 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

825 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