Welcome!
This community is for professionals and enthusiasts of the Genio platform.
Share your questions and challenges, and help your partners!
Validating unique combination
Hello.
I am building a vet clinic app, in which I need to make sure there are no appointments being made for the same doctor at the same time of an already existing appointment.
Example:
Doctor1 has an appointment for 01/10/2019 at 10am. I need to display an error if I try to insert another appointment for the same doctor at the same date and time. But if 1 of the 3 properties is different, it should be added.
So basically what I need to know is how can I make a combination of 3 variables unique?
Thanks in advance,
You just concatenate the 3 properties together with an Arithmetic formula, then you can setup your unique constraint on that calculated field.
When using different data types your best bet is usually to convert everything to string. Be careful with padding things correctly so that things are really unique.
Keep Informed
About the Community
Question tools
Stats
Asked: 01/10/2019 11:08 |
Seen: 1888 times |
Last updated: 22/11/2019 11:06 |
That sounds like a good solution. However, I've been trying to convert both the time and date fields to string, but can't seem to find the formulas to do so. I even tried to convert to a numeric first and then to a string, but ran into the same problem. I've made a post about this here: https://forum.quidgest.net/forum/q-a-2/question/converting-dates-and-times-357
Thank you for your time.