Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger Failed Error
Message
From
13/01/2012 06:39:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/01/2012 03:52:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01532864
Message ID:
01532870
Views:
35
To postpone the validation - and for other reasons - you should use buffering. (Another important reason is to let the user undo changes easily.) With buffering, the triggers won't be evaluated until changes are saved.

To enable buffering, put the following in Form.Init():
Cursorsetprop("Buffering", 5) && Third parameter can be omitted for currently selected table
When user does changes and then clicks on a "Save" button, try to confirm the changes with TableUpdate()
if not TableUpdate()
  local laError
  aerror(laError)
  MessageBox("Can't save changes; error number " + trans(laError(1) + chr(13) + chr(10);
    + "Message: " + laError(2))
endif
If the user clicks on a "Cancel" button, the corresponding command is:
TableRevert()
CursorSetProp("Buffering"), TableUpdate() and TableRevert() all have additional parameters for the alias, but I was assuming you work with only one alias.

HTH,

Hilmar.

>I have RI condition like following:
>
>RI Condition Parent Table Child Table Update Delete Insert Parent Tag Child Tag
>
> t004 t077s Restrict Restrict Restrict ktopl
>
>In BROWSE mode, as soon as I add a record with Ctrl-Y, the empty record is validated. I have triggers. I receive the error message (trigger failed).
>
>With View | Append mode, the record update (and validation) is postponed until we go to the next record.
>
>In form, I am facing same problem while executing append blank.
>
>The code is:
>
>SELECT t077s
>llSuccess=CURSORSETPROP("Buffering", 5, "t077s")
>APPEND BLANK IN ('t077s')
>thisform.SetAll('readonly',.f.,'Textbox')
>thisform.SetAll('readonly',.f.,'Combobox')
>thisform.cboKtopl.SetFocus()
>thisform.refresh()
>
>Please help me how to write code properly in form.
>
>Regards,
>
>Swarup Modak
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform