>Adding deleted() to one of the fields in my view did no reflect a .T. when the view was called up and requeried. The field always indicated a .F., I think the function deleted() is being evaluated after the set is created and by then the select statment has already created the cursor and the record is not deleted in the cursor. If you experiment with it and find this wrong I would like to know. What I did to experiment was to go to the view designer in the
Ok... here is what I did...
open data MyDataBase
set deleted off
create view testdel as select *,deleted() as Deleted from mytable
modi view testdel
I made it updateable, and set the where to key fields only. Make sure the deleted column isn't set as modifyable. Save the view Then...
use MyTable
browse
Mark a few rows deleted
use
now:
use testdel
Ok... this is where it gets tricky... the deleted field should be T for those records marked deleted... however, the records are not deleted in the view.
So, you can't recall the record in the view and do table update. Code your system so that if someone presses the Undelete button you do the following code...
recall for id=iCurrentRecordID in MyTable
requery()
When I did this, the deleted field changed from T to F.
Keep in mind... if the buffer is dirty you may want to do a tableupdate. Or, you might want to wait until the user presses save, then do your tableupdate, then do your recalls.
I just tested it, and it does successfully tableupdate() changes made to the deleted records.
HTH,
BOb
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only