Skip to main content

ICATabularService

@spartanfx/react v1.2.2


@spartanfx/react / codeapps / ICATabularService

Interface: ICATabularService<TRecord, TId>

Structural type for a generated tabular service (Dataverse table, SharePoint list, SQL table, etc.).

Extended by​

Type Parameters​

TRecord​

TRecord

The record shape from the matching *Model.ts file.

TId​

TId = string

Primary key type. Defaults to string.

Methods​

create()​

create(record): Promise<ICAResult<TRecord>>;

Create a new record.

Parameters​

record​

Partial<TRecord>

Returns​

Promise<ICAResult<TRecord>>


delete()​

delete(id): Promise<void | ICAResult<void>>;

Delete a record by id.

Two shapes are accepted so consumers can pass the GENERATED service straight in (it returns Promise<void> and throws on error), and normalized adapters can return ICAResult<void> for parity with the other CRUD methods.

Parameters​

id​

TId

Returns​

Promise<void | ICAResult<void>>


get()​

get(id): Promise<ICAResult<TRecord>>;

Retrieve a single record by id.

Parameters​

id​

TId

Returns​

Promise<ICAResult<TRecord>>


getAll()​

getAll(options?): Promise<ICAResult<TRecord[]>>;

Retrieve multiple records with optional query.

Parameters​

options?​

ICAGetAllOptions

Returns​

Promise<ICAResult<TRecord[]>>


getMetadata()?​

optional getMetadata(options?): Promise<ICAResult<unknown>>;

Optional: fetch Dataverse entity metadata. Present on generated Dataverse services; absent on SharePoint connector services.

Parameters​

options?​

unknown

Returns​

Promise<ICAResult<unknown>>


getReferencedEntity()?​

optional getReferencedEntity(searchText, referencedEntity): Promise<ICAResult<unknown>>;

Optional: fetch the option list for a referenced column (Choice, Lookup, Person/Group) on a SharePoint list. Present on generated SharePoint services from PAC CLI 1.50+; absent on Dataverse services. See: https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/sharepoint-operations

Parameters​

searchText​

string

referencedEntity​

string

Returns​

Promise<ICAResult<unknown>>


update()​

update(id, changes): Promise<ICAResult<TRecord>>;

Update an existing record. Only changed fields should be sent.

Parameters​

id​

TId

changes​

Partial<TRecord>

Returns​

Promise<ICAResult<TRecord>>