Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check change

Status
Not open for further replies.

raai

Programmer
Jul 17, 2008
30
MX
This forum is great.

I need create a logger system but I don't know how to please help me.

I want register a Insert, Change o Delete records.

Thanks!
 
Hey Raai

Did you try with triggers?

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.

Hope you can find an easier way, regards
 
Thank's

RobertoMexicali, I don't have worked with trigger.
 
ShankarJ, thank's too but in this moment i dont have money

RobertoMexicali have you a manual of triggers
 
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

4.- just put your code

 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top