contentWindow iframe crm 2016 [英] 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屋!