Topic: Execution priorities

Hello Dmitry and all MVD fans,


I've found something I was not aware of, but maybe it's me.


As I have data that goes in different tables on a Form, I linked the SAVE button so that MVD handles most of the data savings in the main table, and I added an OnClic event on that same button for the additional data.


Getting the last inserted ID on the main table with :

last_id := SQLExecute('SELECT MAX(id) FROM asset');

because somehow, Last_Insert_id('asset') does not work for me, I noticed that all the data I save with the onclick event are linked to the id of the previous record, and not the last one.

It seems that the OnClic event saves data BEFORE the MVD button and it's internal script. Am I right ?


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Execution priorities

OnClick occurs before record is saved, try to use event OnAfterClick

Dmitry.

Re: Execution priorities

And this was just under my eyes the whole time.....


Thanks Dmitry, I'll look closer next time before asking silly questions  smile


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor