Unique record 3 entities

Hello, I have 3 entities, Accout, Registration and Event (img 1). Table 'Registration' is a combination of Account and Event, so all users can register for an event. Now I want to be the combined records unique, so it is not possible for someone to register for the same Event on the same date. How can this be done? Thanks, Joey
1 answers

Create a custom save button. Add a validation on this condition by retrieving a Registratie object from the database with the same values, e.g.

//Registratie [id != $Registratie] [Date = $Registratie/Date] [Registratie_Account = $Registratie/Registratie_Account] [Registratie_Event = $Registratie/Registratie_Event]

If such a registration exists, present the user with an error. Otherwise, commit the object.