Hello all you FMP Road Warriors,
I have a solution in FMP12 (FileMaker Server) for scheduling.
How can I flag a record t show this scenario:
Staff person has a day off, perhaps multiple days, like a vacation
Customer books an appointment, or appointments to see staff person on one of her days off
Show an alert to the scheduler that the staff person is not available on those days
I kind of just figured it out while I was typing the question
Set a flag on all the days that are marked as time off
If a new appointment falls on a flagged day, then show alert
Is that the long and short of it?
Some of the bookings can cover weeks, so each new record would have to check against the flags. I would use a loop here.
Any tastier solutions?
All the best,
You could use ExecuteSQL, à la (using imaginary element names)
ExecuteSQL ( "SELECT (*) FROM Dates WHERE fk_StaffID = ? AND theDate = ? AND dayOff = 1 " ; "" ; "" ; selectedStaffID ; selectedApptDate )
or do the same by checking the dayOffStatus using a native relationship via selectedStaffID and selectedApptDate.