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?
optionalrecipient:string
The recipient for which the data is being fetched, used for logging and mapping purposes.
Example
"R0100"
fields?
optionalfields:ReadonlyArray<keyofT>
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?
optionalmapping:Partial<Record<keyofT,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()?
optionalmappingFunction: (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?
optionalmodifiedSince: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?
optionalmodifiedSinceField: keyofT
The field to use for filtering entities modified since a certain date. Must be specified if modifiedSince is specified.
Example
"Modified_Date_Time"
filter?
optionalfilter:string
An additional OData filter string to apply when fetching entities.
Example
"Status eq 'Open'"
top?
optionaltop:number
The maximum number of records to fetch. If not specified, all records will be fetched.
Example
100
skip?
optionalskip:number
The number of records to skip for pagination. If not specified, no records will be skipped.
Example
100
orderby?
optionalorderby:string
The field(s) to order the results by. Must be a valid OData orderby string.
Example
"Order_Date desc, No asc"
expand?
optionalexpand:object[]
Navigation properties to expand inline. Each entry is the navigation property name, optionally with nested $select fields.
name
name:
string
fields?
optionalfields:string[]
Example
[{ name: "brz_goodsreceiptHeaderPurchReceiptLines", fields: ["Line_No", "Quantity"] }]