markhutch Posted July 8, 2009 Posted July 8, 2009 Hi. I'm brand new to Filemaker although fairly handy around MS Access, Oracle etc. Here's my problem/question: I have to tables - for the sake of this example, I'll use card. So the parent contains makes of car (Ford, GM, VW etc) and the child table are models. The related field is the make. I want to be able to scroll through the parent (car makes) and any child records (models) of that make should display all the fields of the child record in a form (NOT a row!!!) but in several columns and laid out in an arbitrary fashion to my design. I only want a single model to be displayed at a time and the vertical scroll bar (or another mechanism (button?)) should allow me to go through all the models for that make. I have achieved this up to a point, but the following problems occur: 1. selecting a parent(makes) record correctly displays the first child record ... but ... if I click the vertical scroll bar up or down or below the slider (to page down), a duplicate parent record is generated! 2. I need to able to search using a field in the parent AND a field in the portal record. E.g. "ford" in the parent record and "blue" in the portal record. I would expect to be able to then scroll through ONLY blue ford records in the portal. I've tried disabling triggers and scripts by unchecking Browse and Find in Set Script Triggers with the portal selected. In fact, I uncheck Browse for each of the script names, but when I hit OK and immediately go back into to Set Script Triggers, the Enabled in: Browse is checked again! My only assumption is that FileMaker cannot show a parent record and individual child records that are laid out in a form (rather than in a single row like ALL the examples I've found so far of portals). Is this true? Is there another way of achieving what I'm after. Hoping someone knows the answer!
bcooney Posted July 8, 2009 Posted July 8, 2009 (edited) Given the car analogy, you would have a unique serial ID for each Make (although, I'd probably go one higher and also have Manufacturer, then Make, then Model). Each Model will have the foreign MakeID. So, on a Make form layout, you would create a portal that shows all child Models. This portal does not have to be only one row high. It can be any size you want, with the related Model fields displayed in any arrangement that you want. The portal scroll bar will leaf thru the related records just the same as if the related data was in one row. Script triggers have nothing to do with this, and afaik, you don't need any. Field Behavior>Browse Mode turns on and off the ability to edit the field data in browse mode. Sometimes you let a user edit related records from a parent, and sometimes you prefer to have them go to the related record and edit it on a child form layout. Can you post a zipped demo of what you have? Perhaps I can see if the way you set up relationships is causing problem #1. As for finding, it's best to go to the child (Model) table to find. Edited July 8, 2009 by Guest
markhutch Posted July 8, 2009 Author Posted July 8, 2009 Thanks. I'll give that a whirl and let you know what happens!
markhutch Posted July 8, 2009 Author Posted July 8, 2009 I made some changes (not to the IDs though - explanation below) and can now use Find in the parent table to select a parent record. Now all the children are there and viewable if I use the mousewheel. However, using the up/down arrows or clicking in the slider bar or anywhere in the portal boundary creates a duplicate parent! I usually don't give up but on this occasion I think I've reached the limits of what else I can try. I've attached a zipped .fp7 of my database. I'm positive the problems are of my making but just can't see where else to look. No IDs explanation. I understand the logic in your reply but the data was imported from MS-Access and the tag_name fields in the parent and child tables (if_tables, if_rules respectively) was used to relate them. As I can't access anything in the portal in Browse mode I don't know how to enter new records in the child table (if_rules) as selecting New Record generates a record in the parent (if_tables) and not the child. I would appreciate ANY help you can provide. parent_child_issue.zip
bcooney Posted July 8, 2009 Posted July 8, 2009 You have the portal set up as a big button that does a Duplicate Record...and so you'll get a new Parent record every time you click the portal. Select the portal and change this to Do Nothing. Since you have [ x ] Allow Creation of Related records on in the relationship btw the parent and child, you'll see an "empty" portal row if you scoll all the way to the bottom. Just begin typing to create a new child record.
markhutch Posted July 8, 2009 Author Posted July 8, 2009 SOLVED! Well that just proves what a total beginner I am! I can't thank you enough. As soon as it started working as designed I went right ahead and ordered the full version of FM Pro 10. Filemaker thanks you too I'm sure. Have an awesome day! :waytogo:
Recommended Posts
This topic is 5673 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 accountSign in
Already have an account? Sign in here.
Sign In Now