Can't refresh data after Applyupdate

Hi,
I’m using “Status” field to control the records because I want to keep the deleted records. “A” is “Active”, “D” is “Deleted”. So the DASQL will apply “Status <> ‘D’” that show the active records.

If the record is “Deleted”, it will not disappear after Applyupdate. Any better solution to solve it instead of using “Close” and “Open” command.

I found DA has “Log” feature. Is it log the data change? If yes, any example shows how to work.

Hi,

you can apply filter Status <> 'D'.

Can you provide a bit more info about this, pls?
do you mean field.LogChanges?

Hi,
Yes, I want to know about Field.LogChanges

Hi,

from help:

Decides whether changes to this field should be logged as part of the delta so they can layer be applied back to the server. When set to false, the client application will keep no record of changes made to these fields, and any changes made by client application will be lost when the client restarts or refreshes data from the server.

this allows to you to control what fields should be updated

Noted with thanks. Before I guess it can keep the change log in somewhere. Then I need not to decide the record change log. :sweat_smile:

Hi,
About your suggestion to using “filter” feature, only this solution? Because many modules and DBLookupComboBox also use “Status <> 'D”" in Views

Hi,

you can also delete record from table with table.LogChanges = False;

Hi,
Your solution is not my expectation. The following is my code. If using it, it will showing all records after refresh. The default DASQL condition is gone. (Status <> ‘D’)

  tbl_master.Edit;
  tbl_master.FieldByName('SYC_Status').Value := 'D';
  tbl_master.FieldByName('SYC_ModifiedDate').Value := clientdatamodule.GetServerDate;
  tbl_master.FieldByName('SYC_ModifiedBy').Value := SysUser_no;
  tbl_master.Post;
  tbl_master.ApplyUpdates();
  tbl_master.Refresh;

Hi,

why you can’t just do something like ?

  tbl_master.Edit;
  tbl_master.FieldByName('SYC_Status').Value := 'D';
  tbl_master.FieldByName('SYC_ModifiedDate').Value := clientdatamodule.GetServerDate;
  tbl_master.FieldByName('SYC_ModifiedBy').Value := SysUser_no;
  tbl_master.Post;
  tbl_master.ApplyUpdates();
  tbl_master.LogChanges := False;
  tbl_master.Delete;
  tbl_master.LogChanges := True;

Hi,
I need to keep the “D” record in table. It is protection for checking if find any human error.

Hi,

where you should keep this - in DA memtable (client-side) or in table on DB server?

this one just delete record from client-side and keep record on DB server

Hi,
Yes. Thanks for you demo. The result is what I need. Thanks.