Value: Variant;
The Value property determines the value of data source field.
Value determined in this property must have the same data type as the one determined for the field. If the field has a custom type, the link to data stream is specified as the value. To read more about working with custom type fields, use the knowledge base in the articleWorking with fields that have custom data type.
Sub Main;
Var
MB: IMetabase;
DSInst: IDatasetInstance;
Fields: IDatasetInstanceFields;
v, v1: Variant;
Cach: ICachedDataset;
Begin
MB := MetabaseClass.Active;
DSInst := MB.ItemById("Table_1").Open(Null) As IDatasetInstance;
Cach := DSInst.OpenCached;
Cach.Edit;
Fields := Cach.Fields;
Fields.Item(0).Value := 100;
v := Fields.Item(0).Value;
v1 := Fields.Item(0).OldValue;
Cach.Cancel;
End Sub Main;
After executing the example, the value of the first field in data source cache is changed, the "v" variable contains its new value, and the "v1" variable contains the old value of the field. After that all changes are cancelled.
See also: