contentWindow iframe crm 2016 [英] contentWindow iframe crm 2016

查看:110
本文介绍了contentWindow iframe crm 2016的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在下面的代码中尝试访问Webresource。我正在开发CRM 2016

please find below the code where I am trying to access a Webresource. I am working on CRM 2016

var xyz = window.xyz || {};

var xyz= window.xyz|| {};

$(#WebResource)。contentWindow.xyz.Scheduler.load();

$("#WebResource").contentWindow.xyz.Scheduler.load();

给出无法获取未定义或空引用的属性'contentWindow'消息。

Gives out "Unable to get property 'contentWindow' of undefined or null reference" message.

需要帮助。

推荐答案

已经指出;不支持直接操作DOM。但是,如果仅出于调试目的而从F12控制台执行此操作,则可以按如下方式预先调用Xrm对象:

As already pointed out; manipulating the DOM directly is unsupported. However, if you're doing this purely for debugging purposes from the F12 console you can prepend your calls to the Xrm object as follows:

var webResource = frames[0].Xrm.Page.getControl("WebResource_Name");
var content = webResource.getObject().contentWindow.document;

请注意,包含表格的特定框架有时会根据您要查看的表格移动因此,如果frames [0]不起作用,请尝试使用frames [1]。

Note that the specific frame containing the form does move around sometimes depending on which form you're looking at so if frames[0] doesn't work, try frames[1] instead.

这篇关于contentWindow iframe crm 2016的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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