Calculating Fields after FillRecord

I've a Dataset for List-Property of another Entity.

This Dataset got calculated and lookup fields.

A new record is added to the dataset. State is dsInsert, as expected.
Changing my lookupfield triggers some changes on the Entity behind the dataset.
For this I implemented Dataset.RefreshRecord, so that all changes will be loaded to the Dataset.

This works fine except the lookup and calculated fields.
Both stay Empty at all.

creating a own dependent of TAureliusDataset that reintroduces RefreshRecord and putting this code in it, everything works fine:


Looks like FillRecord does not trigger the necessary events for refreshing calculated and lookup-fields.

Thanks for reporting, we will include the fix for the next version.
But note that, for now, you should call GetCalcFields instead of CalculateFields, so it also works when the dataset is not in edit mode.

Thanks for your advice, I already recognized that and but an If State in [dsInsert, dsEdit] right before CalculateFields

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.