I don’t see a field owner_id in de (Servoy) log table (multi tennant ?!), so I added that one myself. Next problem is that I can’t get it filled. I tried the auto-enter and the insert-event on the log table but they both don’t seem to work. I would like that field filled in stead of querying through relations to all other tables with the not so nice formatted pk-field in the log table.
Yes, that is a problem indeed.
I guess that you have implemented your own Users table and so you have two options: you can add a UUID column to your users table or you can add a column called “user_name” to your Log table (Servoy will automatically fill the username).
To filter the table at login time have a look at the databaseManager.addTableFilterParam(), once the filter is set it will persist for the entire session.
I only need one place in my solution to view all the log records of my current owner_id.
I’ll throw in that form the sql-power (of foundset.loadrecords()) where I can do the text-integer conversion of the log table user-uuid field.
Example sql statement I use now : select log.log_id from log ,sec_user us where us.user_id=idf_to_integer(log.user_uid) and us.owner_id=?
where idf_to_integer() is our own written database-dependent user defined function for text-integer conversion.
This way I don’t have to change (hurt) my data model…