Scripting help please
Scripting help please
Hi,
Probably a mistake on my part but I am having trouble with a specific scenario.
2 of my applications forms interact very simply.
Form#1 (Bookings) stores details concerning future events. Each record has a unique reference (REF = an incremental ID number), some basic labels and most importantly a START and FINISH time (fields are date+time). Essentially this form stores room booking information.
Form#2 allows a user to select some details from lookup fields that hook into Form#1 and return basic data.
I want Form#2 (Capacity) to return the reference ID of a record in Form#1 (Bookings) when the user has made two look up selections. 1st selection is a ZONE (a string) and the second is a room number ROOM_ID (also a string)
The ZONE lookup in Form#2 (Capacity) builds the picklist for the ROOM_ID (works fine)
The ROOM_ID picklist, when changed by the user should get the corresponding reference (REF) from Form#1 (Bookings) for the selection where the current time (zoho.currenttime) is between the START and FINISH time for that record.
This is where I am at:
if((count(Bookings[Room_ID == input.Select_Room]) == 0))
{
}
else
{
for each Q in Bookings[Room_ID == input.Select_Room]
{
refs = Bookings[Q.Start <= zoho.currenttime && Q.Finish >= zoho.currenttime];
Booking_Ref=refs.Booking_Ref;
}
}
Any help would be appreciated!