Hi,
I've created a reservation app and added a valid if constraint as follows.
AND(
[Start] < [End],
ISBLANK(
FILTER(
"Room Booking",
AND(
[Room].[ID] = [_THISROW].[Room].[ID],
[Start] < [_THISROW].[End],
[_THISROW].[Start] < [End]
))))
it worked like a charm but then i realized i have a problem where everytime i tried to amend a current entry (existing), the app denied the amendment saying that there's already a reservation made for that particular date.
What's the workaround? Appreciate the help in advance, thanks.
Solved! Go to Solution.
what about:
AND(
[Start] < [End],
ISBLANK(
FILTER(
"Room Booking",
AND(
[Room].[ID] = [_THISROW].[Room].[ID],
[Start] < [_THISROW].[End],
[_THISROW].[Start] < [End]
[keyColumnOfYourTableRoomBooking]<>[_THISROW]
)
)
)
)
or
AND(
[Start] < [End],
ISBLANK(
FILTER(
"Room Booking",
AND(
[Room].[ID] = [_THISROW].[Room].[ID],
[Start] < [_THISROW].[End],
[_THISROW].[Start] < [End]
[_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]
)
)
)
)
what about:
AND(
[Start] < [End],
ISBLANK(
FILTER(
"Room Booking",
AND(
[Room].[ID] = [_THISROW].[Room].[ID],
[Start] < [_THISROW].[End],
[_THISROW].[Start] < [End]
[keyColumnOfYourTableRoomBooking]<>[_THISROW]
)
)
)
)
or
AND(
[Start] < [End],
ISBLANK(
FILTER(
"Room Booking",
AND(
[Room].[ID] = [_THISROW].[Room].[ID],
[Start] < [_THISROW].[End],
[_THISROW].[Start] < [End]
[_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]
)
)
)
)
Thank you! that worked liked a charm. I'm using the second one but i believe the first one should work.
Have a good day ahead!
User | Count |
---|---|
16 | |
10 | |
9 | |
8 | |
3 |