I have a form with the following fields:
Name (string) Phone (phone) Place (dropdown) Time (dropdown)
I need that when I submit my form it verifies the following validations:
For each Place, 3 times are listed, and I can only save 3 people for each Time of each Place, except for one Place where 4 records can be saved.
I'm having difficulty creating this logic in the button flow, can someone help me?
Hi Diogo,
the form validation is running locally on the client side, so it cannot check for the most recent database status. Thus you should validate this on the server side in your VolunteersCreateOrUpdate action. If the validation fails, you can throw an exception or just return an output parameter in your server action that is indicating that something went wrong. In both cases your client side screen action should handle the failed validation.
Nevertheless, you should always do a server side validation and not solely trust the client side form validation as it can be tweaked.
Kind regards, Sebastian