Dynamics crm js实现通过按钮打开某一实体窗体

//获取新生成的id,在新窗口中打开新
function openNewRecords() {
    var fl_newrecord = Xrm.Page.getAttribute("new_nextplanguid");  ---要打开实体的id
    var fl_writeinproductid2 = fl_newrecord.getValue();
    if (fl_writeinproductid2 == "" || fl_writeinproductid2 == undefined) {

    }
    else {
        if (fl_writeinproductid2 != fl_newrecord && fl_newrecord != "") {
            //fl_writeinproductid2 = fl_writeinproductid2[0].id.replace(/\{/, "").replace(/\}/, "");
            fl_newrecord.setSubmitMode("always");
            Xrm.Page.data.entity.save();
            var windowOptions = {
                openInNewWindow: true
            };
            Xrm.Utility.openEntityForm("new_communicationplan", fl_writeinproductid2, null, windowOptions);
        }
    }
}

你可能感兴趣的:(Dynamics crm js实现通过按钮打开某一实体窗体)