无法从打开的框架网络资源Dynamics CRM 2011中访问window.parent的Xrm.data.entity对象 [英] Unable to access window.parent's Xrm.data.entity object from a opened frame web resource Dynamics CRM 2011
问题描述
我有一个html网络资源
I have a html web resource that has
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
在头。当用户单击功能区中的拒绝时,会弹出一个框架。
当我尝试单击框架(而不是功能区)中的拒绝按钮时,它引发错误错误:无法获取未定义或空引用的属性'实体',我知道我的
in the head. It is a frame that pops up when a user clicks reject in the ribbon. When I try to click on a reject button in the frame (not the ribbon), it throws the error "Error: Unable to get property 'entity' of undefined or null reference" I know my
window.parent.Xrm.Page.context.getServerUrl()
正在工作,因为从我们的服务器填充了查找框架。我尝试了以下操作:
is working because the lookup frame is populated from our server. I have tried the following :
window.parent.Xrm.Page.data.entity.attributes.get("approvalstatus").getValue()
和
window.parent.Xrm.Page.getAttribute("approvalstatus").getValue();
两者都给我错误。我完全迷失了为什么我无法访问父窗口的Xrm.Page对象。
Both give me errors. I'm totally lost as to why I can't access the parent window's Xrm.Page object. Please advise.
推荐答案
解决方案是使用XrmServiceToolkit。我试图从使用 showModalDialog
打开的子页面更新父页面的 Xrm.data.entity
似乎不可能。
Solution was to use XrmServiceToolkit. I was trying to update the parent page’s Xrm.data.entity
from child page that was opened using showModalDialog
but that doesn’t seem to be possible.
XrmServiceToolkit允许您创建允许执行所有CRM操作的SOAP请求。使用以下链接中所述的格式:
XrmServiceToolkit lets you create SOAP requests that allow you to do all CRM operations. Use the format like explained in this link:
这篇关于无法从打开的框架网络资源Dynamics CRM 2011中访问window.parent的Xrm.data.entity对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!