在IFRAME和实体之间进行通信 [英] Communicating between IFRAME and an entity

查看:77
本文介绍了在IFRAME和实体之间进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于访问被拒绝精神错乱,我无法在 onload 函数中使用JavaScript向远程服务器发出请求。因此,为了使CRM服从,我设置了 IFRAME 并将其连接到运行我的JavaScript的HTML页面。现在,假设我在脚本中得到了一些值(在 IFRAME 中运行),如何将它们传递给控股父对象中的方法?

I couldn't make a request to a remote server using JavaScript in the onload function due to access is denied insanity. So, just to make CRM obey, I set up an IFRAME and connect that to a HTML page running my JavaScript. Now, provided that I get some values inside the script (run in an IFRAME) how can I communicate them to a method in the holding parent?

不太清楚如何详细解释它,所以请随时提问。

Not quite sure how to explain it more detailed so please feel free to ask.

推荐答案

最近,我很乐于连接到Web服务并检索一些数据。当实现这一目标时,我发现自己坐在上述数据上并不完全知道该放在哪里。

Recently I had the joy of connecting to a web service and retrieve some data. When that’s been achieved, I found myself sitting on the said data not exactly knowing where to put it.

为了简而言之,我使用了以下源代码。

To make the long story short, I used the following source code.

parent.window.Xrm.Page.data.entity.attributes
  .get("new_Konrad").setValue("Viltersten");

值得注意的是,为了与父表单进行通信,HTML文件(我的JavaScript驻留),需要将其作为网络资源放置在CRM结构中。换句话说,仅通过指向外部 http://some.where/some.thing ,我们就可以使用服务,但无法将获得的信息向上传递到CRM服务器,至少在开发在线版本的解决方案时没有。

Notable is the fact that in order to communicate with the parent form, the HTML file (where my JavaScript resided), needed to be placed as a web resource within the CRM structure. By other words, just by pointing to an external "http://some.where/some.thing" we can consume a service but won’t be able to convey the obtained information up the CRM server, at least not when developing a solution for the on-line version.

这篇关于在IFRAME和实体之间进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆