Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triggers?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00253416
Message ID:
00253559
Views:
24
>>>Hi Dan,
>>>
>>>>If you have a trigger defined for a field in a database, the trigger will fire when the data has been modified. You would normally specify a stored procedure in your trigger and when the user modifies the field, the stored procedure is automatically executed.
>>>
>>>Defined for a field? I only thought it was possible to define one for a whole table. I'm not sure where you would define a field level trigger?
>>
>>Sorry, it should have read "a field in a table that is in a database". You define a field level trigger in the table.
>>
>>The table has to be in a database before you can specify a field trigger. It's actually called "Field Validation" in the table designer. Just open up a database and right click on a table and choose modify. You should see a "Field Validation" section. This is where you specify the field level triggers.
>
>There is a key difference between a trigger and a validation rule. A validation rule has the power to prevent the change from being made. It also has the power to change the contents of the field, or another field in the table. A trigger does not. A cannot modify any fields in the same table. This is to prevent recursion. Returning .F. from a trigger also prevents the change, but the trigger itself is powerless to correct the bad data.

I understand this. Mike is the originator of the thread and was wondering how to create a field level trigger. Make sure you copy Mike on this.
Tim Westmoreland
Software Engineer
Skyline Technologies, Inc.

"Upper classes are a nation's past; the middle class is its future." - Ayn Rand, Russian-born author (1905-1982).
Previous
Reply
Map
View

Click here to load this message in the networking platform