Walter Meester
HoogkarspelNetherlands
General information
Category:
Coding, syntax & commands
Hi Ulises,
>Hi all. First of all let me tell you that my application is coming out very nicely, and I must say a big thank you to all the people who has helped me here.
>Now to my next question:
>I have a form with a grid. The parent part comes from the Products table and the child (the grid) from the inventory table. I have set a relationship in both tables using CodeNumber as the common field.
>I have also set the referential integrity rules as follows:
>Parent-Update:Cascade; Parent-Delete: Ignore; Child-Insert: Restrict.
>When I set the grid to AllowAddNew=.T. and try to input a new record (APPEND, APPEND BLANK)in the grid, I got a "Trigger Failed" message BEFORE writing anything. How can a trigger fail if I haven't written any data? How to avoid this?
You've got a few possibilities:
1. Use an INSERT INTO and fill the required fields inmediatetely.
2. Set record- or tablebuffering to on and commit the insert with a TABLEUPDATE.
3. Use the defaultvalue properies of a table to put any default values in the required fields.
Personally, In your situation, I would enable tablebuffering and update with lError=TABLEUPDATE(2, .T., "yourAlias").
HTH,
Walter,
Walter,
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only