使用自定义参数(数据)将动态参数(字段值)传递到Dynamics CRM上的Webresource [英] passing dynamic parameter (field values) to webresource on Dynamics CRM using custom parameter (data)

查看:266
本文介绍了使用自定义参数(数据)将动态参数(字段值)传递到Dynamics CRM上的Webresource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法将值输入到Webresource iframe网址的查询字符串中。我将字段名称(模式名称)添加到自定义参数(数据),并在查询字符串(静态)上获取字段名称,而不是字段值。

Can't get the values into the querystring of the webresource iframe url. I add the field name (schema name) to the custom parameter (data) and get the field name on the querystring (static) and not the field value.

推荐答案

即使有帖子说您可以将动态值传递给Webresource的自定义参数(数据),但我的经验与上述Adi相同,这些参数仅用于静态值。

Even though there are posts saying you can pass dynamic values to the custom parameter (data) of the webresource, my experience is the same as Adi's above, that those parameter are only for static values.

在那种情况下,我发现将表单字段的值添加到webresource中的最简单的选择比我尝试做的还要简单。只需添加: window.parent。,您就可以访问 Xrm.Page 。因此,您所要做的就是:

In that case the easiest alternative I found to get the values of the form fields into the webresource are even simpler than what I was trying to do. By just adding: window.parent. you get access to Xrm.Page. So all you have to do is:

var formfieldValue = window.parent.Xrm.Page.getAttribute("CRMFieldSchemaName").getValue();

别忘了将其放在网络资源上的javascript标记内:

Don't forget to place it within a javascript tag on the webresource:

<script type="text/javascript">
  $(function () {
     var formfieldValue = window.parent.Xrm.Page.getAttribute("CRMFieldSchemaName").getValue();
  });
</script>

这篇关于使用自定义参数(数据)将动态参数(字段值)传递到Dynamics CRM上的Webresource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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