Microsoft Dynamics CRM 2011 Lookup记录选择窗口完全自定义方式

var lookupViewArgs = {

items: null,

customViews: [{

id: "{F86239AE-C483-E211-B9C3-00155D332305}", //自定义视图ID(随意取)

recordType: 2, //实体类型

name: "TEST", //自定义视图名称

fetchXml: '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true"><entity name="contact"><attribute name="fullname"/><attribute name="telephone1"/><attribute name="contactid"/><order attribute="fullname" descending="false"/><link-entity name="new_test" from="new_contact" to="contactid" alias="ak"><link-entity name="account" from="accountid" to="new_account" alias="al"><filter type="and"><condition attribute="accountid" operator="eq" uiname="Fabrikam, Inc. &amp;#40;&amp;#31034;&amp;#20363;&amp;#41;" uitype="account" value="{F86239AE-C483-E211-B9C3-00155D332305}"/></filter></link-entity></link-entity></entity></fetch>',

layoutXml: '<grid name="resultset" object="2" jump="lastname" select="1" icon="1" preview="1"><row name="result" id="contactid"><cell name="fullname" width="300" /><cell name="telephone1" width="125" /></row></grid>',

Type: 0

}],

availableViews: null

};

var url = "http://crm2011s/Demo/_controls/lookup/lookupinfo.aspx?AllowFilterOff=1&DefaultType=2&DefaultViewId=%7bF86239AE-C483-E211-B9C3-00155D332305%7d&DisableQuickFind=0&DisableViewPicker=0&LookupStyle=single&ShowNewButton=1&ShowPropButton=1&browse=false&objecttypes=2";

openStdDlg(url, lookupViewArgs, 800, 500);

原文地址:https://www.cnblogs.com/allenhua/p/2960720.html