Zum Hauptinhalt springen

GetEntitiesOptions

GetEntitiesOptions<T, MappedT> = object

Type Parameters

T

T

MappedT

MappedT = T

Properties

name

name: string

The name of the BC entity to fetch

Example

"brz_orderdata"

companyId

companyId: string

The BC company ID (GUID) to fetch entities for.

Example

"bae11b10-7a01-f111-a1f9-7c1e52fa7677"

recipient?

optional recipient: string

The recipient for which the data is being fetched, used for logging and mapping purposes.

Example

"R0100"

fields?

optional fields: ReadonlyArray<keyof T>

The fields to fetch from BC, if not specified, all fields will be fetched. If no fields are specified, the mapping (if provided) will be used to determine which fields to fetch.

Example

["No", "Order_Date", "Status"]

mapping?

optional mapping: Partial<Record<keyof T, string>>

A mapping object to map BC fields to target fields. If provided, only the fields specified in the mapping will be fetched, if fields are not explicitly specified.

Example

{ No: "orderNumber", Order_Date: "orderDate", Status: "status" }

mappingFunction()?

optional mappingFunction: (item, recipient) => MappedT

A mapping function to map BC entities to target entities. The function receives the original entity and the recipient as parameters.

Parameters

item

T

recipient

string

Returns

MappedT

Example

(item, recipient) => ({
orderNumber: item.No,
orderDate: item.Order_Date,
status: item.Status,
recipient: recipient
})

modifiedSince?

optional modifiedSince: Date | string

If specified, only entities modified since the given date will be fetched. The modifiedSinceField option must also be specified to indicate which field to filter on.

Example

"2025-01-01"

modifiedSinceField?

optional modifiedSinceField: keyof T

The field to use for filtering entities modified since a certain date. Must be specified if modifiedSince is specified.

Example

"Modified_Date_Time"

filter?

optional filter: string

An additional OData filter string to apply when fetching entities.

Example

"Status eq 'Open'"

top?

optional top: number

The maximum number of records to fetch. If not specified, all records will be fetched.

Example

100

skip?

optional skip: number

The number of records to skip for pagination. If not specified, no records will be skipped.

Example

100

orderby?

optional orderby: string

The field(s) to order the results by. Must be a valid OData orderby string.

Example

"Order_Date desc, No asc"

expand?

optional expand: object[]

Navigation properties to expand inline. Each entry is the navigation property name, optionally with nested $select fields.

name

name: string

fields?

optional fields: string[]

Example

[{ name: "brz_goodsreceiptHeaderPurchReceiptLines", fields: ["Line_No", "Quantity"] }]