I have a T-Tournament table (Uniqkey, description, date, …)
I have a T-Reservation table (Uniqkey, date, Users)
I have a button that adds a Row to the T-Reservation table with T-Tournament and User data, for a User
But, if the User clicks several times, he will add several records. Grrrr
Solution 1: Show the button only if the User has not already registered (UniqKey + User)
But how ?
Solution 2: Prevent adding the row if (UniqKey + User) already exists in the T-Reservation table.
But how ?
If you create a relation or query linking the Tournament table to the Reservation table using the tournament key, you can put a visibility condition on the button to only display if the relation or query is empty.
Hi Jeff,
Thanks a lot for your answer.
This solution was already tested, but If another User makea reservation, all user cannot reserve anymore.
I need to check USER and TOURNAMENT KEY. With Relation, I can use only one field
Well, you can use a template column to join the user and tournament into a value to use for your relation, or you can simply specify tournament and user in a Query column. It’s doable. Just need to check both values.
In table T-REGISTRATION, I have Tournament-id, and email.
In the Query, I can compare CurrentUser/email with T-Registration/email
but (don’t have the selected Tournament) with T-Registration/email
Use a query column. Query where tournament id >is >this row >tournament id and user email> is signed in user (or user id > is > user > user id).
If query is not empty then user already registered.
T-Registration - Template to create a unique key (tournament-id + User-id)
T-Tournament - Template to create a unique key (tournament-id + User-id)
T-Tournament - Lookup on R-Key-Tour-User
C-lookupReg
RULES on Button
T-Tournament - C-Key-Tour-User not included in C-lookupReg

Thanks a lot