|Subject||Re: [IBO] Catching errors|
> I try to catch errors, that occure when user tries to post recordAFAICT OnError only occurs for server generated errors, and the "is a
> with missing mandatory fields, so I could try to fix them on the fly
> or give user some menaingful messages. I tried to use TIB_Query
> OnError event, but it doesn't get called - I see IBO errormessage:
> "FIELD1 is a rfequired field", but I can't catch it .
> What event should I use to handle these errors?
required field" error comes from IBO (when you have
I notice you cant use the OnPostError handler either, since the
CheckRequired is performed before the part of IBO that uses
I usually put try/except around the post call itself.
Another possibility is to turn CheckRequired off, so that the IBO wont
check and issue the message. Any missing fields will be reported by
the server - and then you should be able to detect them via OnError.
None of this is perfect, since it can be difficult to determine
exactly which field is causing problems (and therefore be able to do
something intelligent in response).