Interface for the online API Execute and ExecuteMultiple are only available when online, not offline.

Hierarchy

Methods

  • Deletes an entity record.

    Parameters

    • entityLogicalName: string

      The entity logical name of the record you want to delete. For example: "account".

    • id: string

      GUID of the entity record you want to delete.

    Returns PromiseLike<string>

    On success, returns a promise object containing the attributes specified earlier in the description of the successCallback parameter.

  • Execute a single action, function, or CRUD operation.

    Parameters

    • request: any

      Object that will be passed to the Web API endpoint to execute an action, function, or CRUD request.

    Returns PromiseLike<ExecuteResponse>

    See

    External Link: Xrm.WebApi.online.execute (Client API reference)

    Remarks

    The object exposes a getMetadata method that lets you define the metadata for the action, function or CRUD request you want to execute.
    The getMetadata method has the following parameters:

    • boundParameter: (Optional) String. The name of the bound parameter for the action or function to execute.
      • Specify undefined if you are executing a CRUD request.
      • Specify null if the action or function to execute is not bound to any entity.
      • Specify entity logical name or entity set name in case the action or function to execute is bound to one.
    • operationName: (Optional). String. Name of the action, function, or one of the following values if you are executing a CRUD request: "Create", "Retrieve", "RetrieveMultiple", "Update", or "Delete".
    • operationType: (Optional). Number. Indicates the type of operation you are executing; specify one of the following values:
      • 0: Action
      • 1: Function
      • 2: CRUD
    • parameterTypes: Object. The metadata for parameter types. The object has the following attributes:
    • enumProperties: (Optional) Object. The metadata for enum types. The object has two string attributes: name and value
    • structuralProperty: Number. The category of the parameter type. Specify one of the following values:
      • 0: Unknown
      • 1: PrimitiveType
      • 2: ComplexType
      • 3: EnumerationType
      • 4: Collection
      • 5: EntityType
    • typeName: String. The fully qualified name of the parameter type.
  • Execute a collection of action, function, or CRUD operations.

    Parameters

    • request: any[]

      An array of one of one of the following types: -objects where each object is an action, function, or CRUD request that you want to execute * against the Web API endpoint. Each object exposes a getMetadata method that lets you define the metadata for the action, function or CRUD request you want to execute. This is the same object that you pass in the execute method. For information about the object, see execute. -change set (an array of objects), where each object in the change set is as defined above. * In this case, all the request objects specified in the change set will get executed in a transaction.

    Returns PromiseLike<ExecuteResponse[]>

  • Retrieves a collection of entity records.

    Parameters

    • entityLogicalName: string

      The entity logical name of the records you want to retrieve. For example: "account".

    • Optional options: string

      (Optional) OData system query options or FetchXML query to retrieve your data.

      • Following system query options are supported: $select, $top, $filter, $expand, and $orderby.
      • To specify a FetchXML query, use the fetchXml attribute to specify the query.
      • NOTE: You must always use the $select system query option to limit the properties returned for an entity record 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.
      • You can specify multiple system query options by using & to separate the query options.
    • Optional maxPageSize: number

      (Optional) Specify a positive number that indicates the number of entity records to be returned per page.

      • If you do not specify this parameter, the default value is passed as 5000. If the number of records being retrieved is more than the specified maxPageSize value, nextLink attribute in the returned promise object will contain a link to retrieve the next set of entities.

    Returns PromiseLike<RetrieveMultipleResult>

    On success, returns a promise object containing the attributes specified earlier in the description of the successCallback parameter.

  • Retrieves an entity record.

    Parameters

    • entityLogicalName: string

      The entity logical name of the record you want to retrieve. For example: "account".

    • id: string

      GUID of the entity record you want to retrieve.

    • Optional 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 PromiseLike<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)

  • Updates an entity record.

    Parameters

    • entityLogicalName: string

      The entity logical name of the record you want to update. For example: "account".

    • id: string

      GUID of the entity record you want to update.

    • data: any

    Returns PromiseLike<any>

    On success, returns a promise object containing the attributes specified earlier in the description of the successCallback parameter.

Generated using TypeDoc