Bug 148853 - "Before Submitting" event of a Base form does not fire
Summary: "Before Submitting" event of a Base form does not fire
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.0.6.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-29 13:42 UTC by Aaron Gerber
Modified: 2023-01-10 12:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test Database (1.75 KB, application/vnd.sun.xml.base)
2022-04-29 13:43 UTC, Aaron Gerber
Details
Test Database that actually has contents (11.45 KB, application/vnd.sun.xml.base)
2022-04-29 15:43 UTC, Aaron Gerber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Gerber 2022-04-29 13:42:56 UTC
Description:
I can set up a brand new .odb file, give it a single table, create a form with a grid for filling in the table.  If I pull up the Form Properties, go to the "Events" tab and select a macro for "Before submitting", and save the form, it does not work.  When I start using the form to populate the table, new records can be entered into the table without the macro's being launched.

Steps to Reproduce:
1.Create a new database in Base. (Use HSQLDB.)  Save it as Test Datase.odb on the desktop.
2.Create a Table "Characters" with two columns: Make the first "id int(10)unsigned auto_increment primary key" and the second "name varchar(55)".
3.Create a macro in a trusted location:
sub Say_Hey()
  msgBox "Hey!"
End Sub
4.Create a Form with a grid to the Characters table.  Right-click the grid and click "Form Properties".  Click the "Events" tab.  For the "Before submitting" event, select the Say_Hey macro.
5.Save the Form and open it for use.  Start by entering the name "Mickey Mouse" in the "name" column.  Then hit Tab.  It will move on to the next record.  enter "Donald Duck" and close the form.  If prompted to save the data, click "Yes".  Now open the table and observe its contents.

Actual Results:
Both characters were entered into the table without the macro ever having been launched.

Expected Results:
When hitting Tab after Mickey Mouse and when hitting "Yes" to saving the data, the "Hey" message box should have cropped up.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.6.2 (x64)
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Aaron Gerber 2022-04-29 13:43:59 UTC
Created attachment 179846 [details]
Test Database
Comment 2 Aaron Gerber 2022-04-29 13:48:08 UTC
This is kind of a big deal, because it prevents vetoing of submission.
Comment 3 Aaron Gerber 2022-04-29 15:43:56 UTC
Created attachment 179847 [details]
Test Database that actually has contents
Comment 4 Aaron Gerber 2022-04-29 15:52:29 UTC
Comment on attachment 179847 [details]
Test Database that actually has contents

Note: I did not include the macro in this file.  Instead, I parked it in a trusted place on my machine.  To use the file, you'll have to create the macro per the instructions and put it in a trusted place on your machine, and then point the "Before submitting" event to it.
Comment 5 Robert Großkopf 2022-05-14 09:28:08 UTC
"Before submitting…" happens, if you submit the data as URL through a website. There is no URL given in form properties.
Seems you are looking for
"Before record action…"
This is the point to see, if all input is well. If it is false record action will be stopped.
Comment 6 Robert Großkopf 2022-05-19 16:50:54 UTC
Have tested it with a given URL in form properties.
Added a button, which should submit the content - not save or update or something like this.
The event "Before submitting…" happens.

So I can't confirm a buggy behavior here with LO 7.3.3.2 on OpenSUSE 15.3 64bit rpm Linux
Comment 7 Buovjaga 2023-01-10 12:50:02 UTC
No comments from reporter, so assuming the advice given by Robert was enough.