【问题标题】:Microsoft Dynamics: Value of the field shows on the form, but it doesnt show on the grid viewMicrosoft Dynamics:字段的值显示在表单上,​​但不显示在网格视图上
【发布时间】:2013-03-21 04:38:57
【问题描述】:

我对字段值的可见性有疑问。我正在使用 MS Dynamics CRM。在我对该字段进行编码后,在表单中,该字段的值完美显示。但是,它并没有出现在视图中。

我已经尝试过,onSaveonLoadread-only 等,但它不起作用。我也调试过,没有报错。我不知道问题是什么。

代码:

function change_currentstatus() {
    var chk0 = document.getElementById('new_pc1');
    var chk1 = document.getElementById('new_m1');
    var chk2 = document.getElementById('new_m2');
    var chk3 = document.getElementById('new_m3');
    var chk4 = document.getElementById('new_m4');
    var txt = document.getElementById('new_currentstatus');
    if(!chk4.checked == false) {
        txt.value = 'm4';
    } else if(!chk3.checked == false) {
        txt.value = 'm3';
    } else if(!chk2.checked == false) {
        txt.value = 'm2';
    } else if(!chk1.checked == false) {
        txt.value = 'm1';
    } else if(!chk0.checked == false) {
        txt.value = 'pc1';
    } else {
        txt.value = ' ';
    }
}

可能设置或 JavaScript 有问题。

【问题讨论】:

  • 表单上的字段是只读的吗?

标签: javascript dynamics-crm-2011 field microsoft-dynamics


【解决方案1】:

我的第一个观察结果是:使用 CRM 2011 javascript 对象模型,简历here。因此,要读取字段,请使用:

var varMyValue = Xrm.Page.getAttribute("CRMFieldSchemaName").getValue();

设置值:

Xrm.Page.getAttribute("po_CRMFieldSchemaName").setValue('My New Value');

所以你必须改变这段代码:

if(!chk4.checked == false)
    txt.value = 'm4';

替换为:

if(!Xrm.Page.getAttribute("new_m4").getValue() == false)
   Xrm.Page.getAttribute("new_currentstatus").setValue('m4');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-21
    • 2015-10-12
    • 2017-12-18
    • 2019-09-19
    相关资源
    最近更新 更多