Bob: Here's my answers to your thoughtful questions: Was the Deletedby value actually null or a blank? If it was blank, then the computer name would not be captured with the "is null" parameter. Good question. I did a "sel count(*) from tmpclaimsdeleted where deletedby is null" and all records come up. So it is a Null Just in case there is some odd condition with nulls, you could set the var vtext = ( (CVAL('NetUser')) & (Cval('Computer')) ) and capture both all the time, thus avoiding the IF nulls. I could try that, thanks for the suggestion I see that you are using double quotes? Yes, using double quotes My help states the cval syntax is 'Computer' instead of 'ComputerName' ? My test shows that cval "computer" and "computername" return the same result Karen
-----Original Message----- From: Robert Thompson <ttc....@comcast.net> To: 'Karen Tellef' via RBASE-L <rbase-l@googlegroups.com> Sent: Fri, Mar 11, 2022 7:43 pm Subject: Re: [RBASE-L] - Delete Trigger mystery? A couple of thoughts...(some obvious, but it never hurts to ask!) Was the Deletedby value actually null or a blank? If it was blank, then the computer name would not be captured with the "is null" parameter. Just in case there is some odd condition with nulls, you could set the var vtext = ( (CVAL('NetUser')) & (Cval('Computer')) ) and capture both all the time, thus avoiding the IF nulls. I see that you are using double quotes? My help states the cval syntax is 'Computer' instead of 'ComputerName' ? -Bob On 3/11/2022 6:01 PM, 'Karen Tellef' via RBASE-L wrote: Why I needed the before-delete trigger: no one should ever be deleting data from this table. And although they have the full version of RBase, no one knows how to "get to the R> prompt". There is a monthend routine that the senior user runs that will delete a batch of data, but that's all (we remove the trigger before this monthend routine, then put it back on) Yet every now and then we find data mysteriously disappeared. So I created a before-delete trigger. It takes the record to be deleted and appends it to an archive table. 3 columns in the archive table will hold the deleted date / time and the user who deleted it. Works perfectly at my development environment and when I test it at the place where the database is installed. Records the date, time and the user. However, twice now we have found records in that archive table that had been deleted (hundreds at a time). The records had the deleted date/time but had NO user name. Here's the code I use in my stored procedure. The DeletedDate and DeletedTime works fine, it gets updated every time. There is no login to this app, so I grab the NetUser (used many times in the application for other things, successfully). The first time that the archive had no user name, I modified the stored procedure to grab the ComputerName. But still, nothing..... SET VAR vText TEXT = NULL SET VAR vText = (CVAL("NetUser")) IF vText IS NULL THEN SET VAR vText = (CVAL("ComputerName")) ENDIF UPDATE ClaimsDeleted SET DeletedDate = .#DATE, DeletedTime = .#TIME, + DeletedBy = .vText WHERE claim = .spClaim Can anyone think of anything else I can trap that would help me figure out how/when the records got deleted? Or does anyone know how records could get deleted when there actually is no NetUser or ComputerName? Karen -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/1654695576.980450.1647043308102%40mail.yahoo.com. -- Robert Thompson TTC. Inc. 219-363-7441 -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/c5a2daa4-0240-af9c-b33f-558ae652cee6%40comcast.net. -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/42530637.1085053.1647101404875%40mail.yahoo.com.