Answered by:
IFrame to a custom entity not working

Question
-
Hi All,
I've read and followed numerous blog posts related to this issue and I thought I followed everything correctly, however I am still having problems. Basically, I have a custom entity (sold business) and want to display another custom entity (sold benefit) via an iframe. Here is my code that is located in Sold Business > Form > Form Properties > OnLoad:
var navId = “neu_neu_soldbusiness_neu_soldbenefit”;
if(document.getElementById(navId) != null)
{
var tmp = document.getElementById(navId).onclick.toString();
tmp = tmp.substring(tmp.indexOf(“‘”)+1, tmp.indexOf(“;”));
var loadArea = tmp.substring(0, tmp.indexOf(“‘”));
var roleOrd = (tmp.indexOf(“roleOrd”) == -1) ? -1 : tmp.substring( tmp.indexOf(“roleOrd”), tmp.lastIndexOf(“‘”)).replace(“\\x3d”, “=”);
crmForm.all.IFRAME_soldbenefit.src = (roleOrd == -1) ? GetFrameSrc(loadArea) : GetFrameSrc(loadArea) + “&” + roleOrd;}
function GetFrameSrc(tabSet)
{
if (crmForm.ObjectId != null)
{
var id = crmForm.ObjectId;
var type = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
var path = document.location.pathname.substring(0, document.location.pathname.indexOf(“edit.aspx”)) + “areas.aspx?”;return (path + “oId=” + id + “&oType=” + type + “&security=” + security + “&tabSet=” + tabSet);
}
else
{
return “about:blank”;
}
}After publishing, all that appears is a blank box. When I save and close a sold benefit record I receive an error that states:
"Microsoft Dynamics CRM has encountered an error. Please tell Microsoft about this problem." The error gives me the usual "send error report" or "don't send."
My code knowledge is novice at best so this is my last resort to help find a solution.
Thanks!
Wednesday, August 10, 2011 10:39 PM
Answers
-
Hello Eddie,
Try to replace symbols “ and ” with " and ‘ with ' or take script from following article - http://jianwang.blogspot.com/2009/05/crm-40-iframe-show-entitys-associated.html
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Jim Glass Jr Thursday, August 11, 2011 7:47 PM
- Marked as answer by Jim Glass Jr Thursday, August 11, 2011 7:47 PM
Thursday, August 11, 2011 12:22 AMModerator
All replies
-
Hello Eddie,
Try to replace symbols “ and ” with " and ‘ with ' or take script from following article - http://jianwang.blogspot.com/2009/05/crm-40-iframe-show-entitys-associated.html
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Jim Glass Jr Thursday, August 11, 2011 7:47 PM
- Marked as answer by Jim Glass Jr Thursday, August 11, 2011 7:47 PM
Thursday, August 11, 2011 12:22 AMModerator -
Hi Andriy,
Thank you for the syntax corrections. The error screen no longer pops up when saving & closing a record however my iFrame is still showing blank box. Would you happen to know what may be causing the blank box?
Thursday, August 11, 2011 7:26 PM -
Hi Andriy,
Thank you for the syntax corrections. The error screen no longer pops up when saving & closing a record however my iFrame is still showing blank box. Would you happen to know what may be causing the blank box?
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
Friday, August 12, 2011 3:52 AMModerator -
I created a new record and also tried editing an existing record. Both ways I get a blank box.Friday, August 12, 2011 5:59 AM