>Thanks Hilmar, I have used the stuff from your article and actually have it working on this table (although the delete tag has no code). For simplicity sake I would like the tag to be located in the primary table rather than the audit table. Any thoughts on triggering the tag upon recall?
If you record the deleted action on a separate table, you can record multiple delete / recall actions.
Recording in the same table doesn't seem possible through triggers. But pressumably you don't delete in a BROWSE window; so you can have the logic in the form (REPLACE, followed by DELETE). This is especially simple to generalize to several tables, if all your forms are based on the same base classes.
>
>
>
>>I would suggest to implement an audit trail that records ALL changes done by users, to any table, to a separate audit table - who did what change, and when.
>>
>>See my article for the general idea, and some simple sample code that can help you get started. Universal Thread Magazine, May 2003, "A Basic Audit-Trail".
>>
>>>I am trying to write a stored procedure that will set a field tag to true when a record is deleted. The purpose being that records are frequently deleted and recalled but we want to know if it had been deleted at a previous time. My code
>>>
>>>function tagdeleted()
>>> delstatus = set('deleted')
>>> set deleted on
>>> replace wasdeleted with .t.
>>> set deleted &delstatus
>>>endfunc
>>>
>>>fails with an error that says the cursor is readonly which is not true cause I can edit other fields without a problem. The function is called with a ondeleted trigger. Suggestions on what I'm doing wrong?
>>>Thanks
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)