Interface a Lookup attribute.

Hierarchy

Implements

Constructors

Properties

Name: string
_customFilters: any = []
viewId: `${string}-${string}-${string}-${string}-${string}` = ...

Accessors

  • get EntityType(): string
  • Gets the entityType of the first lookup value

    Returns string

  • get FormattedValue(): string
  • Gets the formatted value of the first lookup value

    Returns string

  • get Id(): string
  • Gets the id of the first lookup value

    Returns string

Methods

  • Adds a custom view to filter the lookup using FetchXML Only works for one table at a time, cannot add views for multiple tables at the same time

    Parameters

    • fetchXml: string

      The complete FetchXML query including filtering conditions

    Returns LookupField

    The LookupField instance for method chaining

  • Adds an additional custom filter to the lookup, with the "AND" filter operator.

    Parameters

    • filterXml: string
    • Optional entityLogicalName: string

      (Optional) The logical name of the entity.

    Returns LookupField

    Remarks

    If entityLogicalName is not specified, the filter will be applied to all entities valid for the Lookup control.

    Example

    Example filter: <filter type="and">
    <condition attribute="address1_city" operator="eq" value="Redmond" />
    </filter>
  • Parameters

    • entityLogicalName: string

      (Optional) The logical name of the entity.

    • primaryAttributeIdName: string

      (Optional) The logical name of the primary key.

    • fetchXml: string

      Specifies the FetchXML used to filter.

    Returns Promise<void>

    Deprecated

    Use addCustomView instead, which provides more flexible filtering capabilities and better performance Adds an additional custom filter to the lookup, with the "AND" filter operator.

    Remarks

    If entityLogicalName is not specified, the filter will be applied to all entities valid for the Lookup control.

    Example

    Example fetchXml: <fetch>
    <entity name="contact">
    <filter>
    <condition attribute="address1_city" operator="eq" value="Redmond" />
    </filter>
    </entity>
    </fetch>
  • Removes all filters set on the current lookup attribute by using addPreFilterToLookup or addPreFilterToLookupAdvanced

    Returns LookupField

  • Extracts entity name from fetchXml

    Parameters

    • fetchXml: string

    Returns string

  • Generates layoutXml based on fetchXml attributes

    Parameters

    • fetchXml: string

    Returns string

  • Gets a boolean value indicating whether the Lookup is a multi-value PartyList.

    Returns boolean

    true the attribute is a PartyList, otherwise false.

  • Clears the notification identified by uniqueId.

    Parameters

    • uniqueId: string

      (Optional) Unique identifier.

    Returns LookupField

    true if it succeeds, false if it fails.

    Remarks

    If the uniqueId parameter is not used, the current notification shown will be removed.

  • Retrieves an entity record.

    Parameters

    • options: string

      (Optional) OData system query options, $select and $expand, to retrieve your data.

      • Use the $select system query option to limit the properties returned by including a comma-separated list of property names. This is an important performance best practice. If properties aren’t specified using $select, all properties will be returned.
      • Use the $expand system query option to control what data from related entities is returned. If you just include the name of the navigation property, you’ll receive all the properties for related records. You can limit the properties returned for related records using the $select system query option in parentheses after the navigation property name. Use this for both single-valued and collection-valued navigation properties.
      • You can also specify multiple query options by using & to separate the query options.

    Returns Promise<any>

    On success, returns a promise containing a JSON object with the retrieved attributes and their values.

    Example

    options example:

    options: $select=name&$expand=primarycontactid($select=contactid,fullname)
    

    See

    External Link: retrieveRecord (Client API reference)

  • Sets a lookup with a lookup from the retrieved record.

    Parameters

    • selectName: string
    • retrievedRecord: {
          [x: string]: any;
      }
      • [x: string]: any

    Returns void

    Example

    var contact = await fields.Contact.retrieve('?$select=_parentcustomerid_value');
    fields.Account.setLookupFromRetrieve('_parentcustomerid_value', contact);
    //Alternate
    fields.Account.setLookupFromRetrieve('parentcustomerid', contact);
  • Sets the value of a lookup

    Parameters

    • id: string

      Guid of the record

    • entityType: any

      logicalname of the entity

    • name: any

      formatted value

    • append: boolean = false

      if true, adds value to the array instead of replacing it

    Returns LookupField

  • Sets a control-local notification message.

    Parameters

    • message: string

      The message.

    • uniqueId: string

      Unique identifier.

    Returns LookupField

    true if it succeeds, false if it fails.

    Remarks

    When this method is used on Microsoft Dynamics CRM for tablets a red "X" icon appears next to the control. Tapping on the icon will display the message.

  • Sets the value.

    Parameters

    • value: any

      The value.

    Returns void

    Remarks

    Attributes on Quick Create Forms will not save values set with this method.

Generated using TypeDoc