Hi, You can also apply the Field Validation. Set in the Rule box !Empty(this.Value) and users are not able to save the record with that field empty. You can also write an information message in the Mesage box of the field. These fields can be found by modify your table. Regards, Koen
Op wo 2 okt. 2019 om 06:29 schreef MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com>:
I've got a client with a wonky situation where the data (for some unknown reason) gets "blanked out" (not deleted, mind you...just some fields set to blanks). I wanted to add an UPDATE trigger so that I could get some sort of historical update accounting to help me hone in on where the problem might be.
If I've used triggers in VFP then I've totally forgotten how to use them. (Keep in mind that I haven't used VFP DBFs since 2004! This is an app I took over for one of our former buddies, Jeff Johnson, after he passed away.)
I use triggers in MySQL/MariaDB all the time. There, I've got the record object in the OLD and NEW object keywords. Looking at the CREATE TRIGGER Command in VFP help makes me think that the table is the currently selected work area, and as such, I could just do a SCATTER MEMO NAME oRec and then use that oRec variable to insert values into a separate table.
Wanted to bounce this off the community prior to my testing that theory tomorrow. Does that sound right? Tips for a better way to do it? I was going to create a "shadow" copy table and just basically do the following in a database stored procedure:
- assuming current work area is the table where the UPDATE trigger is
firing LOCAL oRec as Object SCATTER MEMO NAME oRec INSERT INTO MyTable_COPY FROM NAME oRec
IF isblank(oRec.Field1) and isblank(oRec.Field2) and isblank(oRec.Field3) then && alert MBSS of problem scenario that should never happen but this must be the bug happening!!!! DO EmailMBSS ENDIF
Can it really be that easy?
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]