Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Dataset Insert and modified property
Thu, Oct 11 2018 8:07 PMPermanent Link

Richard Harding

Wise Nutrition Coaching

If an Insert is performed on a dataset, then the dataset does not have its modified property set to true. Is this correct? It looks like the row has been modified when you view a dataset in a grid.

Before I do a CheckBrowseMode, I check if the dataset is in Insert state and not modified to ensure that the dataset is saved. CheckBrowseMode only saves the dataset if it is modified. Is this the expected behaviour?

=================
 if (not esStockCosts.Modified) and (esStockCosts.State = dsInsert) then
 begin
   esStockCosts.Save;
 end;

 esStockCosts.CheckBrowseMode;


Richard
Tue, Oct 16 2018 3:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< If an Insert is performed on a dataset, then the dataset does not have its modified property set to true. Is this correct? It looks like the row has been modified when you view a dataset in a grid. >>

Are you actually modifying any columns before checking the Modified property ?

And yes, just doing an insert will not cause the Modified property to be set to True.  This is so you can move beyond the end of a bound TGrid, and then back up, without it causing a phantom row to be inserted.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Oct 25 2018 2:20 AMPermanent Link

Richard Harding

Wise Nutrition Coaching

<<Are you actually modifying any columns before checking the Modified property ?>>

Tim

No - the default values are sufficient to allow the row to be posted. I need to add the <if > statement to ensure that the row is posted when the user inserts a new row without adding any details in the other columns.

Richard

if (not esStockCosts.Modified) and (esStockCosts.State = dsInsert) then
begin
  esStockCosts.Save;
end;

esStockCosts.CheckBrowseMode;
Image