Set Clear Field Values
The Entity-Attribute-Value (EAV) model in CRS enables flexible customization of entities by extending their attributes dynamically. This allows users to define and manage additional fields without altering the core data structure. EAV fields are particularly useful when dealing with diverse and evolving data requirements across different modules.
Managing EAV Fields in CRS Entities
Entities that support EAV fields provide dedicated Create and Update API endpoints for seamless data management.
For instance, within the Actors Module, the following API endpoints are available:
- Create an Actor:
{host_url}/api/actors/Actor/CreateActor
- Update an Actor:
{host_url}/api/actors/Actor/UpdateActor
Each of these API commands includes a collection of entity-specific model updates (referred to as ModelUpdates
). Within this collection, a subset of EAV-related model updates can be utilized to set, modify, or clear EAV field values.
The appropriate model update type is determined by the EAV field’s data type, ensuring that the correct update method is applied based on the attribute being modified. Proper implementation of these updates allows for efficient customization and management of entity-specific metadata within CRS.
Model Updates
SetBooleanEavValueModelUpdate
export interface ISetBooleanEavValueModelUpdate {
fieldSystemName: string;
value: boolean;
}
SetDateTimeEavValueModelUpdate
export interface ISetDateTimeEavValueModelUpdate {
fieldSystemName: string;
value: Date;
}
SetDecimalEavValueModelUpdate
export interface ISetDecimalEavValueModelUpdate {
fieldSystemName: string;
value: number;
}
SetEavCatalogSingleValueModelUpdate
export interface ISetEavCatalogSingleValueModelUpdate {
catalogSingleValueId: number;
fieldSystemName: string;
}
SetEntityReferenceEavValueModelUpdate
export interface ISetEntityReferenceEavValueModelUpdate {
fieldSystemName: string;
items: IKeyValuePair<number, string>[];
}
SetIntEavValueModelUpdate
export interface ISetIntEavValueModelUpdate {
fieldSystemName: string;
value: number;
}
SetMemoEavFieldModelUpdate
export interface ISetMemoEavFieldModelUpdate {
fieldSystemName: string;
value: string;
}
SetOptionsEavValueModelUpdate
export interface ISetOptionsEavValueModelUpdate {
fieldSystemName: string;
value: number;
}
SetStringEavValueModelUpdate
export interface ISetStringEavValueModelUpdate {
fieldSystemName: string;
value: string;
}
SetUrlEavValueModelUpdate
export interface ISetUrlEavValueModelUpdate {
fieldSystemName: string;
value: string;
}
ClearEavValueModelUpdate
export interface IClearEavValueModelUpdate {
fieldSystemName: string;
}