Forum Discussion
MarkShnier__You
Qrew Legend
5 years agoI think that this pattern works
List(" ",
If(< 1 and >1, "1"),
If(< 2 and >2, "2"),
If(< 3 and >3, "3"),
If(< 4 and >4, "4"),
If(< 5 and >5, "5"),
If(< 6 and >6, "6"),
If(< 7 and >7, "7"),
If(< 8 and >8, "8"),
If(< 9 and >9, "9"),
If(< 10 and >10, "10"))
.. and continue the pattern to 48
Let me know how you make out in your double booking solution. It's a generic problem which is difficult to solve so you may be onto to something here.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
List(" ",
If(
If(
If(
If(
If(
If(
If(
If(
If(
If(
.. and continue the pattern to 48
Let me know how you make out in your double booking solution. It's a generic problem which is difficult to solve so you may be onto to something here.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
JoshHamilton1
5 years agoQrew Member
Hi Mark,
Just wanted to update you on how I went with this.
So instead of writing a script to handle the lookup I used an automation and relationship field lookups
Here is a summary;
Starting Fields:
[Booking Code] = Venue ID:Court ID:Date
[Start Code] = [Booking Code] & [Start Time ID] (00:00=1, 00:30=2, etc.)
[Finish Code] = [Booking Code] & [Finish Time ID] (00:00=1, 00:30=2, etc.)
[Duration Code] = [Booking Code] & [Duration Time ID] *each duration time id in the list has the booking code prefixing it ([Booking Code] [Duration Time Code 1] / [Booking Code] [Duration Time Code 2] / etc.)
My automation then copies the codes and writes them into fields stored on the related court;
[Starting Codes]
[Duration Codes]
[Finish Codes]
These fields are also relationship lookup fields into from the Courts table into the Bookings table, so that once you select a venue and court in the booking record, the record can see all the existing booking codes made.
I then created 2 formula checkbox fields to check for Start Code conflicts and Finish Code conflicts;
e.g. If(Contains([Court - Start Codes], [(Formula) Start Code]) or Contains([Court - Duration Codes], [(Formula) Start Code]), true, false); then just set up rules to stop the record from being saved if either checkbox is ticked.
The automation also copies the list of codes in the lookup so it basically it ends up just adding the new booking codes to the list.
------------------------------
Josh Hamilton
------------------------------
Just wanted to update you on how I went with this.
So instead of writing a script to handle the lookup I used an automation and relationship field lookups
Here is a summary;
Starting Fields:
[Booking Code] = Venue ID:Court ID:Date
[Start Code] = [Booking Code] & [Start Time ID] (00:00=1, 00:30=2, etc.)
[Finish Code] = [Booking Code] & [Finish Time ID] (00:00=1, 00:30=2, etc.)
[Duration Code] = [Booking Code] & [Duration Time ID] *each duration time id in the list has the booking code prefixing it ([Booking Code] [Duration Time Code 1] / [Booking Code] [Duration Time Code 2] / etc.)
My automation then copies the codes and writes them into fields stored on the related court;
[Starting Codes]
[Duration Codes]
[Finish Codes]
These fields are also relationship lookup fields into from the Courts table into the Bookings table, so that once you select a venue and court in the booking record, the record can see all the existing booking codes made.
I then created 2 formula checkbox fields to check for Start Code conflicts and Finish Code conflicts;
e.g. If(Contains([Court - Start Codes], [(Formula) Start Code]) or Contains([Court - Duration Codes], [(Formula) Start Code]), true, false); then just set up rules to stop the record from being saved if either checkbox is ticked.
The automation also copies the list of codes in the lookup so it basically it ends up just adding the new booking codes to the list.
------------------------------
Josh Hamilton
------------------------------