Dynamics 365 V9 web resource get context

时光毁灭记忆、已成空白 提交于 2019-12-25 03:27:50

问题


I used this article to open a popup window when clicking on a button in the Lead form. In the onclick event of a button in this popup window, I want to set the value of a field in the parent form. How can I do this in V9, since xrm.page is deprecated? I would like to know the equivalent of

window.parent.Xrm.Page.getAttribute("subject")

The line above has a value of null in the lead form.

EDIT: in the link posted by Arun in the comment down here, it is written that "although Xrm.Page is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource."

Since I am opening a popup window, that is not embedded in the form, I can't use parent.Xrm.page. So it is not possible to set a value in thet parent form with a script inside a popup window?


回答1:


You can use window.opener to do it.

window.opener.Xrm.Page.getAttribute('subject').getValue();


来源:https://stackoverflow.com/questions/51485579/dynamics-365-v9-web-resource-get-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!