繁体   English   中英

如何在dynamics crm 2013中更改部分名称

[英]How to change a section name in dynamics crm 2013

如果选中我的复选框,我想更改部分名称,这是我的代码
我试图使用循环,但我仍然有同样的错误!
我收到此错误消息Champ :cac_is_demande_mere Événement onchange Erreur :Unable to get property 'controls' of undefined or null reference

function Demande_Type()
{
    if (Xrm.Page.getAttribute("cac_is_demande_mere").getValue())
    {
        Xrm.Page.getControl("parentcaseid").setLabel("new Field");

        Xrm.Page.ui.tabs.get("general").sections.get("ChildCasesGrid").controls.setLabel("new Field");

    /* var ctrlName = Xrm.Page.ui.controls.get();   
        for(var i in ctrlName) {    
             var ctrl = ctrlName[i];    
             var ctrlSection = ctrl.getParent().getName();  
             if (ctrlSection == "ChildCasesGrid") { 
                   ctrl.setLabel("new Field");  
            }   
        }   */


    }
    else 
    {
        Xrm.Page.getControl("parentcaseid").setLabel("Demande Parente");
        Xrm.Page.ui.tabs.get("general").sections.get("ChildCasesGrid").controls.setLabel("Demandes Filles");
    /* var ctrlName = Xrm.Page.ui.controls.get();   
        for(var i in ctrlName) {    
             var ctrl = ctrlName[i];    
             var ctrlSection = ctrl.getParent().getName();  
             if (ctrlSection == "ChildCasesGrid") { 
                   ctrl.setLabel("Demandes Filles");    
            }   
        }*/
    }

}

根据您的代码,我建议您重新检查某个部分的ID。 它真的是ChildCasesGrid吗? 您能否提供部分设置表单的屏幕截图?

根据提供的屏幕截图,您使用网格的ID而不是放置它的部分。 所以解决方案 - 找到一个部分的ID并将其放入您的代码中。

由于您尝试的唯一.controls遵循此行

Xrm.Page.ui.tabs.get("general").sections.get("ChildCasesGrid")

那么它意味着.get("ChildCasesGrid")结果为null或未定义。

这意味着,你没有提到的任何部分ChildCasesGrid命名的标签里面general :名字的一方是错的(注意,它们是区分大小写)。

部分设置表单的屏幕截图

@andrii butenko这是我的部分的名字

你真的想做Xrm.Page.getControl("ChildCasesGrid").setLabel("new label")来设置子网格的标签

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM