Hello Jean
I see two approaches to achieve what you are after, one with a tiny database modifcation, the other not
//---------- WITH DATABASE MOD:
- add a Boolean field called is_last_import to the table (or what you want), with a default value of 1
- after opening the CSV file but before looping through the lines, update the table to set Boolean field to 0
- update TableGrid to filter on is_last_import = 1
THIS WAY :
- on opening the applictaion, the is_last_import = 1 records are shown in the tablegrid
- they are all reset to 0 and the new batch of import is saved with is_last_import = 1 (default value)
- the tablegrid is refreshed and only shows the last imports
//---------- WITHOUT DATABASE MOD
-your tablegrid must be blank with no settings, it will be filled by query AFTER the import
- after opening the CSV file but before looping through the lines, find MAX(id) from you table and store it in a variable
- after saving to database your new records, find the new MAX(id) in the same table
- fill you tablegrid with the standard script query and a filter condition on journal.id > first_max ID AND journal.id <= second_max_id
Only downside of this method is that, on launch of your software, nothing differentiate the records in your table, so I see no way to show just the last record saved, the tablegrid only fills after a CSV import
Hope this helps and maybe you'lle get better answers from the others
Cheers
Mathias
I'm a very good housekeeper !
Each time I get a divorce, I keep the house
Zaza Gabor