On the dct you add a trigger (could be before or after action)
you can place your code there and will execute in automatic
Example:
Sometimes, i need to identify who why and when a record from certains tables were deleted, so i have a table: (ErasedRecords) and on Table Customers i have a trigger (before delete action) and just copy the customer record into ErasedRecords (just relevant information)
So, when someone asks for a record that "desapears" i can show him who was the user who deleted and when (date and time)
Other way is put some code when the action is accepted, just insert a new record on your log table indicating the action and the record.
On both cases it takes a little time, but it works.
raai, i don't have a manual af that, but you don't really need it, is simple code of clarion, just write it and the clarion engine will take care of everything
You can declare a trigger on yout dct:
1.- Select the file that you want to perform some code before or after an insert,change or delete action
2.- right click on the file and select the "triggers" option, or you can double click on the file and it will take you to the fields/keys/triggers windows, select the trigger's tab
3.- that's all now you can insert change or delete a trigger
Note: if you're a hand coder, then you should RTFM for the CALLBACK command which is what the client side Trigger relies upon.
Basically every file driver command goes through your code, so you can alter it's behavior.
A common head scratcher has to do with with INSERTS, when you have an AutoIncrement then the insert occurs with a blank record, and then a PUT is done to save the filled in record.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.