From RAD Studio API Documentation
Jump to: navigation, search


property NewValue: Variant read GetNewValue write SetNewValue;


__property System::Variant NewValue = {read=GetNewValue, write=SetNewValue};


Type Visibility Source Unit Parent
property public
Data.DB TField


Represents the current value of the field component including pending cached updates.

Use NewValue to examine or change the current value of a field when in the process of applying multiple updates. If the current field value is causing a problem, such as a key violation, when applying updates, datasets generate an OnUpdateError event. Similarly, provider components generate an OnUpdateError event when problems occur posting records from a client, and client datasets generate an OnReconcileError event when informed of problems by the provider. In the event handler, assign a new value to NewValue to correct the problem.

NewValue is the same as Value, except when errors are encountered while posting records. Setting NewValue in an OnUpdateError event handler, an OnUpdateRecord event handler, or an OnReconcileError event handler causes NewValue to differ from Value until the records have finished being applied to the underlying database table.

Note: The NewValue property is only usable when the data is accessed using a TClientDataSet component or cached updates is enabled.

See Also