lookupObjects (Client API reference)

Opens a lookup control to select one or more items.


Xrm.Utility.lookupObjects(lookupOptions).then(successCallback, errorCallback)


lookupOptions: Object. Defines the options for opening the lookup dialog. Has the following properties:

Property Name Type Required Description
allowMultiSelect Boolean No Indicates whether the lookup allows more than one item to be selected.
defaultEntityType String No The default table type to use.
defaultViewId String No The default view to use.
disableMru Boolean No Decides whether to display the most recently used(MRU) item.
Available only for Unified Interface.
entityTypes Array Yes The table types to display.
filters Array of objects No Used to filter the results. Each object in the array contains the following values:
  • filterXml: String. The FetchXML filter element to apply.
  • entityLogicalName: String. The table type to which to apply this filter.
searchText String No Indicates the default search term for the lookup control. This is supported only on Unified Interface.
showBarcodeScanner Boolean No Indicates whether the lookup control should show the barcode scanner in mobile clients.
viewIds Array No The views to be available in the view picker. Only system views are supported.

successCallback: Function. A function to call when the lookup control is invoked. An array of objects with the following properties is passed:

  • entityType: String. table type of the record selected in the lookup control.
  • id: String. ID of the record selected in the lookup control.
  • name: String. Name of the record selected in the lookup control.

errorCallback: Function. A function to call when you cancel the lookup control or the operation fails.


//define data for lookupOptions
var lookupOptions = 
  defaultEntityType: "account",
	entityTypes: ["account"],
  allowMultiSelect: false,
	filters: [{filterXml: "<filter type='or'><condition attribute='name' operator='like' value='A%' /></filter>",entityLogicalName: "account"}]

// Get account records based on the lookup Options