Jump to content

Relationships...Argh!! A relative newbie stuck...


This topic is 7321 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi...I've been working on a project for condominium/property management for a while now, and I'm in the process of revising/updating my project, and I'm running into the same issues from when I started the project and decided to take the easy way out. But now I'd like to get it right. I'm completely self-taught, and still consider myself a relative newbie at this whole designing thing....but enough preamble, here is why I'm writing:

(by the way, I'm using Dev 7 in OS X)

I originally stared the project with FM6, and since moving to FM7 I've been consolidating what was many DBs into one with multiple table (so much nicer!). The tables I'm working with are: Units, People, Bookings, Party Room, Board Room, and Guest Bedrooms (for now). In an ideal world, I'd love to combine the last three into one "Function Room" table, but that's part of the issue I'm about to describe.

Where I'm running into problems is that the Bookings table is basically a daily calendar (each record is a day). On it, there are separate portals to each of the function room tables, displaying that day's bookings. When the functions rooms were each their own DB rather than a table, I had no problem creating relationships for each of them to the Bookings database (using the date field in each function room DB to the date field in the Bookings DB). Now that each room is a table, rather than separate DBs, I'm having this issue: At the moment, I have the relationship from the party room linked by date field to the Bookings DB, and the portal works find. But when I try to link the Boardroom table (by date field) to the Bookings date field, I get the message:

"There cannot be more than one relational path between any two tables in the graph. Another occurance of one of the tables must be added to the graph."

And then it creates "Bookings 2" for me, with a link (date-date) from the Boardroom DB. Okay, then how do I get the Boardroom bookings to show up in the portal on the Bookings layout (which only shows records from Bookings not Bookings 2?

One thought, and something that ultimately is preferable, would be to combine the rooms into one table, with a Room pop-up menu selection, but the problem is, how to I get each entry to show up in Bookings in it's appropriate portal - particlarly is there are multiple entries for a particular day?

I hope at least some of this makes sense. I apologize for being so wordy (and if I've neglected/abused any standards or conventions of decription - again, relative newbie), but this is the only way I know how to describe what I'm doing. Any advice/suggestions would be greatly appreciated. Thanks!

Posted

Yes, your rooms tables should be combined into one. But first you should understand Table Occurrences. In FM7, a table can be accessed through multiple relationships, by a variety of paths. This is similar to how in FM5/6 you could have more than one relationship to the same file, but in FM7 the relationship graph prevents you from creating loops. It is important that only one path be available to get from any Table Occurrence to another. So to create additional relationships to an existing table, you add additional Table Occurrences. This is what was automatically prompted when you tried to create a loop, though you can manually add Table Occurrences through one of the buttons on the bottom.

So back to your structure. Yes, your room tables should be combined into one. To set it up so you can relate to them separately, make sure there is a Room Type field in the Room table that distinguishes the three type of rooms you have. Then in the parent table, use global text fields containing each Room Type:

gRoomType_Bed (global, text) [enter "Bedroom" into this field]

gRoomType_Board (global, text) [enter "Boardroom" into this field]

gRoomType_Party (global, text) [enter "Party" into this field]

Now make three Table Occurrences of the Room table, relating from the parent table to Room by the correct global on the parent side to the Room Type on the Room side, and add a second criteria to the relationship for the Date match:

Booking -< Room by Bed =

Booking::gRoomType_Bed = Room by Bed::RoomType

AND Booking::Date = Room by Bed::Date

This is a multi-criteria relationship, and can be defined by double clicking the relationship line between the Table Occurrences.

You should probably read up on working with Table Occurrences in the User manual or in the tech briefs on the FileMaker web site.

BTW: If it would be useful for users to select from a list of the unassigned rooms, in addition to showing the chosen rooms. You might look at the examples and discussion in this thread about showing unassigned items in a list:

http://www.fmforums.com/threads/showflat.php?Cat=0&Number=128500

  • Newbies
Posted

Thank you so much . This has worked beautifully. And, naturally, it all seems so obvious to me now. But thank you for shining the light on my dilemma.

There's one other thing (at least for now) that I've been struggling to figure out: Entries for both the Party Room and Boardroom are always one-day only bookings. For the Bedrooms, however, often they are multi day reservations. Right now, if someone wants to book a Bedroom for several days, they have to create a separate entry for each day for it to be displayed on each date in Booking. I'm sure you'll agree this is less than ideal. Is there a way (I'm sure there is) that I can create one Bedroom entry with a date range, so that the reservations will appear in Booking on each date of the reservation? Thanks!

Posted

or the Bedrooms, however, often they are multi day reservations. Right now, if someone wants to book a Bedroom for several days, they have to create a separate entry for each day for it to be displayed on each date in Booking. I'm sure you'll agree this is less than ideal. Is there a way

Yes both you previous question and this one seems at least to be solved by this:

http://www.nightwing.com.au/FileMaker/demos7/demo705.html

...I could be wrong but give it a whirl!!!!

--sd

  • Newbies
Posted

What you suggested would work, particularly in avioding scheduling conflicts, etc...But I'm not sure it addresses my immediate issue: Each entry in Booking is one day, and shows that day's booked Rooms. With the Bedrooms, they are usually booked as a date range (start date and end date). How do I get the a Bedroom booking to show up in Booking db on each day that it has been booked? i.e. How to translate 1/21/05 - 1/24/05 into: 1/21/05, 1/22/05, 1/23/05, 1/24/05 ?

Posted

Not really needed just range relate your calender by stacking relations, but since you're using 7Dev, could you also make it by a custom function if you better understands it that way with multiline keys??

http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=18

...to generate the hardly needed multiline key. But you could also get some "heretic" inspiration by tearing this apart. My aim was to get a calender shown horizontally ...I'm still thinking of faster renderings, so it better IWP's....

http://www.fmforums.com/threads/download.php?Number=140165

--sd

This topic is 7321 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.