crm2011的给lookup字段添加自定义视图

function createView(id) {
    //方案信息
    var entityName = "new_partschemeinfo";
    var viweId = id;
    var viewName = "对应产品的方案信息";

    var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
                      "<entity name='new_partschemeinfo'>" +
                        "<attribute name='new_partschemeinfoid' />" +
                        "<attribute name='new_name' />" +
                        "<attribute name='new_schemedescription' />" +
                        "<attribute name='ownerid' />" +
                        "<filter type='and'>" +
                          "<condition attribute='statecode' operator='eq' value='0' />" +
                        "</filter>" +
                        "<link-entity name='new_projectassess' from='new_partschemeinfoid' to='new_partschemeinfoid' alias='ac'>" +
                          "<filter type='and'>" +
                            "<condition attribute='new_status' operator='eq' value='2' />" +
                            "<condition attribute='statecode' operator='eq' value='0' />" +
                            "<condition attribute='new_productprojectid' operator='eq' uitype='new_productproject' value='" + id + "' />" +
                          "</filter>" +
                        "</link-entity>" +
                      "</entity>" +
                    "</fetch>";

    var layOutXml = "<grid name='resultset' object='10034' jump='new_name' select='1' icon='1' preview='1'>" +
                            "<row name='result' id='new_partschemeinfoid'>" +
                                "<cell name='new_name' width='100'/>" +
                                "<cell name='new_schemedescription' width='250'/>" +
                                "<cell name='ownerid' width='100'/>" +
                            "</row>" +
                        "</grid>";

    Xrm.Page.getControl("new_partschemeinfoid").addCustomView(viweId,
                            entityName, viewName, fetchXml, layOutXml, true);
    document.getElementById("new_partschemeinfoid").setAttribute("disableViewPicker", "1");
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值