I'm not even sure if I'm going about this the best way or not - hence my coming here to get a sanity check and suggestions.
I have the following tables:
t_Events
t_BookedItems
and t_Items
The t_Events and t_BookedItems are related.
t_Items is a table full of items that can be booked for events.
I have a Value List: L_Items based on this table. (This is so that at any time, items can be added and the system will still work)
I have currently set up an t_Events Layout, which has a portal to t_BookedItems in it that lists all the related records.
I know I could just format the fields in the portal to have drop down lists etc and add items and records that way - but I want this process to be super easy and speedy to use.
So I set up a checkbox global field that is based on the L_Items value list - with a script attached that, every time you click a checkbox, it goes to the t_BookedItems layout, loops through the global field checkbox, checks for an existing record, if it exists it skips that one. If it doesn't already exist, it creates one.
This works really well and is instant.... however....
I'm getting stumped on when checkboxes are UNchecked. As in, were previously checked and thus has a record - but then gets unchecked, so the record should be deleted.
I could probably bumbled around for another week trialling more loops and variables to get that to work - but it strikes me that maybe there's a better way?
Please chime in if you think there is an easier way - even if it isn't using checkboxes, but perhaps buttons, or little number fields (where you type the number of items), or anything else.
Also chime in if you think its an ok way to do it, and you have an idea about how to solve the UN-checked box issue! THANKS