I'm running into a problem when teachers in my school system create a behavior record (demerit) using a one click button that does everything for them. This is happening in the beginning of the day. In homeroom, the teacher sees a portal showing their advisees. When the teacher checks homework and one is incomplete, a demerit is issued or a behavior consequence is created (both actions are different but follow the same path). The script grabs the ID from that portal row in a variable, moves it to the behavior table or demerit table, creates a record in the respective table. This happens in a window 4000 pts away from the main screen. The idea is that the teacher can click the button and then move to the next student. The users experience an unterrupted flow, allowing them to click the button in the next row with little delay
By the way, this process happens for the attendance and breakfast, though not all at the same time.
The issue is when teachers get click-happy and hit the button 2-4 times (it happens). 4 identical records are created within a fraction of a second of each other (I see that by the auto-enter createdtimestap field)
How would you go about preventing the user from creating duplicate records by double-clicking on that button? WOuld it be as simple as a check to see if a record by that user for that student was JUST created for the exact same thing? A kid can never be absent to school twice in the same day, a kid would almost never get a demerit for the exact same thing in the same class, with the same user, in the same minute of time.