[Solved] Customized Messages

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
mbvisser
Posts: 7
Joined: Mon Apr 30, 2012 7:28 pm

[Solved] Customized Messages

Post by mbvisser »

Hello Everybody,

I wanted to ask if somebody could point me in the direction of a macro
with which I can "catch" an error occurring on a database entry form so that I
can show a custom message?
I have been looking in a number of wiki's and guides but no luck so far.

Thanks a million in advance.
Last edited by mbvisser on Wed Aug 15, 2012 7:23 pm, edited 1 time in total.
OpenOffice.org 4.1.3
AOO413m1 (Build:9783) - Rev. 1761381
OS Windows 10 Home 64-bit Version 1607
OS Build 14393.693
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Customized Messages

Post by Villeroy »

http://www.openoffice.org/api/docs/comm ... orListener

However, the listener does nothing. When I try to nullify a mandatory field I get the built-in message only.

Code: Select all

Sub addErrorListener_onLoad(e)
l = createUnoListener("form_", "com.sun.star.sdb.XSQLErrorListener")
e.Source.addSQLErrorListener(l)
msgbox("e.Source.addSQLErrorListener(l)")
End Sub

Sub form_errorOccured(e)
msgbox("ERROR")
End Sub
Sub form_disposing(e)
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mbvisser
Posts: 7
Joined: Mon Apr 30, 2012 7:28 pm

Re: Customized Messages [Solved]

Post by mbvisser »

Thanks
OpenOffice.org 4.1.3
AOO413m1 (Build:9783) - Rev. 1761381
OS Windows 10 Home 64-bit Version 1607
OS Build 14393.693
Post Reply