Dynamics 365 V9 Web资源获取上下文 [英] Dynamics 365 V9 web resource get context

查看:200
本文介绍了Dynamics 365 V9 Web资源获取上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了点击销售线索"表单中的按钮时,将打开一个弹出窗口.在此弹出窗口中按钮的onclick事件中,我想设置父表单中字段的值.由于不建议使用xrm.page,如何在V9中执行此操作?我想知道等价于

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")

上面的行的潜在客户形式为null.

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

在Arun在此处的注释中发布的链接中,写道:"尽管Xrm.Page已被弃用,但如果将HTML Web资源嵌入到表单中,parent.Xrm.Page将继续工作因为这是从HTML Web资源访问表单上下文的唯一方法."

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."

由于我正在打开一个未嵌入表单的弹出窗口,因此无法使用parent.Xrm.page.因此,无法在弹出窗口中使用脚本在父窗体中设置值吗?

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?

推荐答案

您可以使用window.opener进行操作.

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

这篇关于Dynamics 365 V9 Web资源获取上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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