Hi,
We are planning to use Laserfiche as a means of allowing folks to register to an event. These events have a limited capacity. Is there a way to restrict Laserfiche to only allow a certain number of submissions on a form?
Hi,
We are planning to use Laserfiche as a means of allowing folks to register to an event. These events have a limited capacity. Is there a way to restrict Laserfiche to only allow a certain number of submissions on a form?
Not out of the box. You will have to keep a list/count of registered people and then check that count after each submission to determine if the capacity has been met. Let's say the capacity of the event is 50 people. After each submission, update a database with the person's name and update a count by 1. On each form, you could lookup that count of registered users and if it's already 50, load that into a hidden field and show a message to the user saying the event is full.
You technically could run into a race condition here where many people load up the form when the number of registered users is at 49, and they all submit successfully causing the number of registered users to surpass 50. You can add a secondary check after submission to see if the number of registered users is still under 50. If many people load up and submit the form with 49 attendees, the first submission will check again and see that it's still under 50, increment the count, and move on successfully. The remaining submissions will see the count at 50 and could go down another branch, emailing the attendees that the class had just filled up and they won't be able to join. Any new form loaded up afterwards would show the message on the form itself.
One way to prevent race conditions would be to add a countdown timer that starts when the user loads the form. When the timer runs out, you can disable the submit button and display a message saying the form needs to be reloaded, at which point it would go through the lookup check again.
So, regarding specific tools from Forms and Workflow to accompany Jared's excellent recommendations above:
I'm following you with updating a table in sql to keep a count, but how would you get that number back from the table into a hidden field at the beginning of the process when someone is trying to submit the form? Thanks!