[Gambas-user] DataView Help

T Lee Davidson t.lee.davidson at gmail.com
Tue Jul 11 14:31:36 CEST 2023


On 7/11/23 07:53, Benoit Minisini wrote:
> Otherwise, you can use the DataView.Find() method to move the view to a specific record from a SQL where clause. It's easy if 
> you know the primary keys of the record you just have created.

Gianluigi,

The `students` table has no columns set as unique and the only primary key is `students_id` which is not available until after 
the record is saved.

To have a high confidence of finding the very record that was just saved, you will need a record signature that is as unique as 
possible. The only way I can think to come close to that is to construct a 'where' clause using all the available field values 
(which does not include `students_id`), save it to a global variable in the DataSource.BeforeSave event handler, and then use it 
with Find after DataSource.Save.


-- 
Lee



More information about the User mailing list