Ask Your Question
1

Base: Any workarounds for table's broken `AfterUpdating` & `BeforeUpdating` events?

asked 2017-12-05 07:41:15 +0200

EasyTrieve gravatar image

Whenever data in a table has changed I am hoping to update some things on a form.

For example if you add a new record, or edit an existing record then update the lookup index to reflect the changes. However because of a bug which makes the AfterUpdating & BeforeUpdating events not correctly fire, this not possible.

See: https://bugs.documentfoundation.org/s...

Has anyone else run into these two broken Base events and/or figured out a way around them?

edit retag flag offensive close merge delete

Comments

My answer below may be good enough, but I could give a more complete example if the desired result was clearer. You mentioned that it should "update the lookup index" but I am not sure what that means without further details. In a simple form, adding or removing records will change the underlying record shown for all fields.

Jim K gravatar imageJim K ( 2017-12-05 09:47:59 +0200 )edit
1

@Jim K, I can see that the After Record Action fires when any record change is made, i.e. edit, create, or delete. (And not to be confused with the similarly named After Record Change, which fires when record motion occurs, i.e. forward and backwards, etc.)

That's good enough to get me started. Thanks very much!

EasyTrieve gravatar imageEasyTrieve ( 2017-12-05 18:33:44 +0200 )edit

Good point about the correct event name.

Jim K gravatar imageJim K ( 2017-12-06 15:33:00 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-12-05 09:39:09 +0200

Jim K gravatar image

updated 2017-12-05 09:49:49 +0200

Instead of using events of the table control, use events of the form's underlying record. To do this, open the Form Navigator, right-click on "MainForm" (or whatever your form is called) and select Properties.

Under the Events tab, specify a macro to run for Before record change.

See also https://forum.openoffice.org/en/forum... which gives validation code that calls .uno:RecUndo.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-12-05 07:41:15 +0200

Seen: 29 times

Last updated: Dec 05 '17