lookupObjects (Client API reference)

Applies to Dynamics 365 (online), version 9.x

Opens a lookup control to select one or more items.

Syntax

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

Parameters

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 entity type to use.
defaultViewId String No The default view to use.
entityTypes Array No The entity types to display.
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 Yes A function to call when the lookup control is invoked. An object with the following properties is passed:
- entityType: String. Entity 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 Yes A function to call when you cancel the lookup control or the operation fails.

Xrm.Utility