Page 1 of 1

UniTable and calculated fields

Posted: Fri 20 Jun 2014 08:38
by testpresta
Hello

I am reading in a UniTable component.
I have some calculated fields (defined in Delphi 7 Object Tree View).

When i am setting a value to a calculated field, i get an error saying to me i need to be in edit or insert mode.
But the fields i manipulate are note in database.
Is there a way to bypass the error message ?

Thanks

Re: UniTable and calculated fields

Posted: Fri 20 Jun 2014 09:27
by AlexP
Hello,

This calculated field (as well as all the fields) is "attached" to the DataSet, and to edit any field, the DataSet must be in the dsEdit mode (is set after calling the Edit method). Moreover, if you modify the value of this field, then after calling the Post method the value will be replaced with the one specified in the onCalcFields event.