I am trying to create an equipment booking database. What I'd like is for the person booking the equipment to pick the item from a lookup field (if possible to do multiple items at once would be great for those who need to book multiple items at once for the same time/date) then they would pick the from and to date fields.
From this point when they submit I want it to check if that particular equipment is booked at that time and if so to alert the user that it's booked and to choose another time. So far under the On Add - Validate I have this:
- if(count(Book_Equipment[(Equipment == input.Equipment && From == input.From)]) >0)
- {
- alert "Booking full at this time. Please try some other date";
- cancel submit;
- }
However the code isn't working. It's still accepting any time submitted even if it conflicts with an appointment for that item already booked. Also I would like it not just to check the from time, but the whole duration the item is booked.
I thought about trying to do a drop down for the time slot but often there are multiple time slots that the item would be booked for, such as an event. Unfortunately the date/time field looks awful and confusing since it's in military time. Perhaps creating a multilist field so they can choose several time slots as needed for that date?
One final thing, it would be nice if I could build a Check Availability list that would show timeslots or perhaps show on a calendar what item is booked at what time as a quick check so you wouldn't have to always submit a booking request to know that item is booked at that time. I know this could be done with a calendar view but I think it'd work better if it looked more like a spreadsheet so all the equipment would be listed on the left hand side with the dates or time along the top with the corresponding box filled in if it's booked.
Anyone know how to help with this? I really would appreciate any help on the issue.