javascript - 使用 Javascript 清空 CRM 2013 中电子邮件实体中的发件人字段

标签 javascript crm dynamics-crm-2013

因此,每当我加载页面时,我都会尝试清空电子邮件实体上的发件人字段。我正在尝试使用 javascript 来做到这一点。我的代码如下。

function emptyField(fieldName) {
    var personType = Xrm.Page.getAttribute(fieldName).DataValue = [];
}

我也尝试过

function emptyField(fieldName) {
    var personType = Xrm.Page.getAttribute(fieldName).DataValue = null;
}

但是这些方法似乎都不起作用。谁能告诉我我能做什么?

最佳答案

OOB functionality像这样:

function emptyField(fieldName) {
    Xrm.Page.getAttribute(fieldName).setValue(null);
}

仔细检查 MSDN 页面中的注释:

Updating an attribute using setValue will not cause the OnChange event handlers to run. If you want the OnChange event handlers to run you must use fireOnChange in addition to setValue.

When Microsoft Dynamics CRM for tablets is not connected to the server setValue will not work.

You cannot set the value of composite attributes. More information: Write scripts for composite attributes.

关于javascript - 使用 Javascript 清空 CRM 2013 中电子邮件实体中的发件人字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28040648/

相关文章:

javascript - 在js中向外界隐藏变量值

javascript - 多个属性值 jQuery

migration - 将内部部署 MS Dynamics CRM 2013 升级到内部部署 MS Dynamics CRM 2015

javascript - 快速创建记录后刷新记录下的字段值

javascript - 如何在 Dynamics CRM 中启用 CORS?

javascript - UglifyJS 属性重整

javascript - SystemJS/Aurelia 应用程序在 PhantomJS 中中断

javascript - 无法从展开中检索属性

.net - 可同步的CRM系统

c# - CRM Online RetrieveMultiple 与 OptionSetValueCollection 条件