On Sun, Jul 22, 2018 at 2:58 AM Patrick Gelin <[email protected]> wrote:

> Hi,
>
> I would like to control key generation by macro when inserting a new row
> into a form with Base. But the risk is to execute twice insert action :
> the first with my handling insert event (I want to manage the mapping
> and use my own generated keys) and the second by the form base code
> automatically ....


There are two paths to this:
One: setup a inert trigger in the database engine to do this.
Details on creating triggers vary depending on the engine you are using.
This works if the data you use to assemble your key is already in the
database (fields in other tables for instance).
OR
Two: handle it with the client application (Base) which seems to be the
advice you are getting so far.

The decision as to which way to go depends on how you want to use it, doing
it with a triggere means that any form, or table grid, attached to the
table will pick up the function but you if you want to read values from
form controls to construct your key the client side work work best.

Best wishes,

Drew

>


> So, if I set the property {AllowInserts = false}, do the Form stop to
> handling the insert but continue to fired /"Before Record Action"/ and
> /"After Record Action"/ events ? I think no, because the form could will

not display the new line to insert ...
>

Ok, that question gets into


>
> So I need to stop the handlind to the Form after my own into events. But
> I understand /"After Record action"/ event handling use a /"Sub"/ action
> not a /"function"/, so I can't return false after my handling ...
>
> So how to do ?
>
> Thank you for your help...
> Patrick
> /
> /
>
> --
> To unsubscribe e-mail to: [email protected]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

-- 
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Reply via email to