Sure, as long as you either filter the relationship or the portal itself to only show the rooms that are eligible for selection.
Tie the button to grab the ID of the room in the portal row selected, and then go create your "reservation" with that room ID.
The room is only occupied if the start timestamp of the new course is in between the previus resevated course on that room. Would you use the Case og Let function for this?
Even though you're working with solid colors, as opposed to images, the following might still be useful:
It demonstrates the use of a grid of buttons that manipulates the images in said grid. Instead of images in containers, you'd probably use text fields with Conditional text formatting (fill color). The script "Click" is probably of most interest to you.
It uses rows of a repeating field to create the grid.
(Note that the button grid, an "overlay", is transparent.)
I would use a global field to store my “proposed start time” for the course I am selecting. I would then add a relationship to reservations to get other reservations that “overlap” the globally selected reservation, using the List() function to get a list of the room IDs associated with those overlapping reservations. Then I would filter the portal of rooms by a simple function of the Room ID not being in the overlap list.
Okey, I have now a portal that only showing the meetingsrooms as the type. But if I want to show all the meetingsroms if they are availeble or not, just with different formatting, would that be possible?
Do you mean using that global variable as a parameter for the List function ?
Just take the filter calculation from the filter in the portal, and put it into conditional formatting instead.
okey thanks, but I cant do a list function in the conditional formatting.
This is my portal filter now:
kurs_ROM::Romkategori ≠ "Overnattingsrom"
How do I make a list with both occupied and not occupied?