Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Refresh record before editing


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Feb 28, 2018 5:10 AM Last Post By: Andreas Schulze
Andreas Schulze

Posts: 4
Registered: 10/30/16
Refresh record before editing  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 27, 2018 10:31 PM
Dear all,

at the moment we're migrating the database component of our application from the BDE component to the FireDAC component.

In the BDE Component (TTable) we had the following behavior when we edit the record of an DataSet:
1. the record to be edited is refreshed and changes which would be done by anyone other are available
2. the DataSet is set to edit mode (DataSet.State = dsEdit)

The FireDAC Component (TADTable) starts immedidately with the editing. There is no refresh of the record before the DataSet is set to the edit mode.
Is there an option/property which we can set to achive the BDE behavior (refresh before editing)?

Thanks for your help...
Michael Sawyer ...

Posts: 9
Registered: 9/10/17
Re: Refresh record before editing  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2018 12:18 AM   in response to: Andreas Schulze in response to: Andreas Schulze
You may just call "tbl.RefrechRecord" in "BeforeEdit" event of the FDTable.
It would be even better if you had a timestamp field in the table, which you can query and than refresh the record on demand.

I know there is a property "RefreshMode" in UpdateOptions, but this only refreshs the record after posting/editing.

Andreas Schulze wrote:
Dear all,

at the moment we're migrating the database component of our application from the BDE component to the FireDAC component.

In the BDE Component (TTable) we had the following behavior when we edit the record of an DataSet:
1. the record to be edited is refreshed and changes which would be done by anyone other are available
2. the DataSet is set to edit mode (DataSet.State = dsEdit)

The FireDAC Component (TADTable) starts immedidately with the editing. There is no refresh of the record before the DataSet is set to the edit mode.
Is there an option/property which we can set to achive the BDE behavior (refresh before editing)?

Thanks for your help...
Andreas Schulze

Posts: 4
Registered: 10/30/16
Re: Refresh record before editing  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2018 4:51 AM   in response to: Michael Sawyer ... in response to: Michael Sawyer ...
Thanks for your reply Michael...

In our application we are using a derived TADTable... Our goal is to implement the solution in our derived class... Maybe it could be problematic to perform an refresh before every edit, as you recommended.

Today we found out that the BDE triggers the refresh in the method TBDEDataSet.InternalEdit.
Maybe we have to override the InternalEdit of our derived TADTable class, but until yet we don't know which methods we can/should use to refresh the record before the editing starts.

Michael Sawyer Yin wrote:
You may just call "tbl.RefrechRecord" in "BeforeEdit" event of the FDTable.
It would be even better if you had a timestamp field in the table, which you can query and than refresh the record on demand.

I know there is a property "RefreshMode" in UpdateOptions, but this only refreshs the record after posting/editing.

Edited by: Andreas Schulze on Feb 28, 2018 4:52 AM
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Refresh record before editing  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2018 4:56 AM   in response to: Andreas Schulze in response to: Andreas Schulze
Andreas Schulze wrote:
Family of Klaus Schulze?
Andreas Schulze

Posts: 4
Registered: 10/30/16
Re: Refresh record before editing  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2018 5:10 AM   in response to: Robert Triest in response to: Robert Triest
No...

Robert Triest wrote:
Andreas Schulze wrote:
Family of Klaus Schulze?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02