Used to make requests to Recommendation providers

Type Parameters

  • T = Record<string, any>

Constructors

Properties

CreateErrorList?: boolean

If true, creates a list that will contain additional informaton regarding errors that may occur during the recommendation run

CurrentUser?: UserInfo

UserInfo object to use when applicable.

EntityAndRecordsInfo?: {
    EntityName: string;
    RecordIDs: (string | number)[];
}

This is an optional field that can be passed in instead of the Recommendations field. If passed in, the Recommendations field will be populated with Recommendation Entities whose Primary key value matches any of the RecordIDs passed in.

Type declaration

  • EntityName: string

    The name of the entity that the RecordIDs belong to

  • RecordIDs: (string | number)[]

    The RecordIDs to fetch recommendations for. Note that if the record IDs

ErrorListID?: string

The ID of the error list, if one was created

ListID?: string
Options?: T

Additional options to pass to the provider

The specific provider to use for the request. Leave this undefined if you want to use the default provider.

Recommendations?: RecommendationEntity[] = []

Array of the requested recommendations. When preparing a batch of recommendations to request, do NOT set the RecommendationRunID or attempt to save the Recommendation records. This will be done as the batch is processed. You cannot save a Recommendation record until a Run is created which is done by the RecommendationEngineBase.Recommend() method.

RunID?: string

The ID of the RecommendationRun record that will be created by the caller of a given provider. This must be created before a provider is called. This is done automatically by the Recommendation Engine and can be populated manually if for some reason you want to call a provider directly outside of the engine. This is a required field.