简体   繁体   English

新浏览器窗口问题中的CRM弹出式Silverlight应用程序

[英]CRM pop-up Silverlight application in new browser window issue

I have developed a silverlight application that is launched from a CRM form. 我已经开发了从CRM表单启动的silverlight应用程序。 The form has a field and in the OnChange event of the field, it calls window.open to open a HTML web resource: 该表单具有一个字段,并且在该字段的OnChange事件中,它调用window.open打开HTML Web资源:

window.open(serverUrl + "")... window.open(serverUrl +“”)...

The HTML web resource contains an iframe that embeds the silverlight control. HTML Web资源包含一个嵌入了Silverlight控件的iframe。

The silverlight control has a "Save Data" button that saves data back to the CRM form. silverlight控件具有“保存数据”按钮,可将数据保存回CRM表单。 This all works fine on my development PC, however, on other PC, the data are not saved back to CRM. 这些在我的开发PC上都可以正常工作,但是在其他PC上,数据不会保存回CRM。

I put debugging messages and the Xrm object is null. 我放入调试消息,并且Xrm对象为null。 In the silverlight code, I am accessing the Xrm object by: 在Silverlight代码中,我通过以下方式访问Xrm对象:

HtmlPage.Window.Eval("document.parentWindow.opener.Xrm") as ScriptObject; HtmlPage.Window.Eval(“ document.parentWindow.opener.Xrm”)作为ScriptObject;

This works on my development PC but doesn't work on other PC, does anyone know why this is happening? 这在我的开发PC上有效,但在其他PC上无效,有人知道为什么会这样吗? Is this a permission or browser settings issue? 这是权限或浏览器设置问题吗?

I also tried to run "document.parentWindow.opener.Xrm" in IE developer tool's script window on the other PC while the silverlight control is open, and i can see the DOM object ok?? 我还尝试在Silverlight控件打开的同时在另一台PC上的IE开发人员工具的脚本窗口中运行“ document.parentWindow.opener.Xrm”,并且可以看到DOM对象吗?

Regards, 问候,

Jerry 杰瑞

It seems i have to get the Xrm object in silverlight directly for it to work in IE9: 看来我必须直接在Silverlight中获取Xrm对象才能使其在IE9中工作:

window = HtmlPage.Window.Eval("document.parentWindow.opener.Xrm") as ScriptObject; window = HtmlPage.Window.Eval(“ document.parentWindow.opener.Xrm”)作为ScriptObject;

This doesn't seem to work in IE9, only works in IE8: 这似乎在IE9中无效,仅在IE8中有效:

window = HtmlPage.Window.Eval("document.parentWindow.opener") as ScriptObject; window = HtmlPage.Window.Eval(“ document.parentWindow.opener”)作为ScriptObject;

xrmObject = window.GetProperty("Xrm") as ScriptObject; xrmObject = window.GetProperty(“ Xrm”)作为ScriptObject;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM