How to manage EAV fields

General way to add field customization to entities in CRS is to extend entities by EAV fields support. Now EAV fields are supported for following entities:

  • Actors module - Actor;

  • Financial module - SalesOrder, SalesOrderQuote;

  • Scheduling module - CalendarTaskEntity

In this document is described how to manage EAV fields and values.

 

 

Set /clear EAV field values

Each entity which supports EAV fields have Create/Update API endpoints/commands.

For example Actors may be created by using {host_url}/api/actors/Actor/CreateActor URL and updated by using {host_url}/api/actors/Actor/UpdateActor URL

Each of these commands contains a collection of entity-specific model updates (named ModelUpdates) and there are set of EAV-field related model updates that may be used for set/clear of EAV fields. These model updates need to be added to ModelUpdates collection. EAV field type’s kind determines which model update need to be used to set specific field.

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

SetEntityReferenceEavValueModelUpdate

SetIntEavValueModelUpdate

SetMemoEavFieldModelUpdate

SetOptionsEavValueModelUpdate

SetStringEavValueModelUpdate

SetUrlEavValueModelUpdate

 

Also there is model update for clear EAV value named ClearEavValueModelUpdate