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");
}