latestart Posted March 12, 2004 Posted March 12, 2004 Greetings everyone. Sorry for the newbie stuff, but having followed the manual to the letter ( I believe), and reading many of the portal-related emails here, after several days I still need help... I
stanley Posted March 12, 2004 Posted March 12, 2004 Latestart: It sounds like you've formatted the portal and field correctly. Perhaps there is no related data? Make sure that your relationship is functional by checking that the data in the related field in "Capacity" has a match in the related field in the record(s) in "Properties"... -Stanley
latestart Posted March 12, 2004 Author Posted March 12, 2004 Stanley, Thanks for the quick response. As far as I can tell, the relationship is set up correctly, at least it appears consistent with the image in the FM 3 User's Guide, as illustrated in my first email. My understanding of a portal is that it's just a window from some file
CyborgSam Posted March 12, 2004 Posted March 12, 2004 > shouldn't I expect to then see the 86 property names from the Properties file appear as a vertical list in the Capacity file portal's Name field? No, if I'm understanding everything you did. You will only see properties that match the text in "Capacity"'s Name field. If you want to see all information in another file, create a number global in Capacity and set it to 1 (True), then create a number in Properties. I'd name both some variation of True. Then create & exceute a script in Properties thaqt will fill in True for all records: Show All Records Replace Contents ["True", "1"] (use the calculated result in the dialog box and just enter 1) Make sure the layout you're on in Properties has the field True on it or the script won't work. Does this make sense? Did I answer the right question?
latestart Posted March 12, 2004 Author Posted March 12, 2004 CyborgSam, I'm not sure about how the answer applies yet, but as I study your advice it starts to dawn that two questions are evolving here... The first is that the master Capacity File Name field is blank, no record at all from any related Name field in the Properties File is showing up. So as shown in the first email above, is my name-field-to-name-field relationship set up right? The second question comes from the User's Guide, which states, "Place related fields in a portal in the layout to display data from all found related records in the related file. (A portal establishes a one-to-many correspondence between data in the master file and data in the related file.)" This says to me that the "Name" field in the Capacity File's portal should itself establish the connection with the 86 "Name" fields in the Properties File without further tweaking or scripting. No? To recap: In the first instance, why is the Name field in the Capacity File portal showing nothing at all. After that, what should normally be seen in the Name field of the portal in the Master Capacity File? What does the manual's "one-to-many correspondence" feature refer to if not to the idea that the purpose of a field in a portal allows one field in the master file to display many identical fields in the related file? Sorry for the elaboration, but I hope to be as clear as possible...whew! Thanks.
stanley Posted March 13, 2004 Posted March 13, 2004 Latestart: I think maybe you don't have a full grasp of what's "supposed" to happen here. I'm still not sure what you want to see in your portal, but it's probably one of two things: either you want to see every record in "Properties" or you want to see every record in "Properties" that has the identical "Name" data as the record you are viewing in "Capacity." What CyborgSam suggested will allow you to do the first thing - see every record in "Properties" from any record in "Capacity." What I was suggesting will do the second thing - see every record in "Properties" that has the same "Name" as the current record in "Capacity." However, there is a flaw (I think) in what you're doing, if you're after the second case. If your relationship is based on the "Name" field, then you already know what's in that field - it'll be the same as the "Name" field in the current record in "Capacity." You stated that the "Capacity" file "Name" field is blank. In that case, you're not going to get a match anyway. I'd send you an example file so you could see it clearly, but the earliest version of FMP I've got is 5.5, so no dice... I hope it's a bit clearer now. If not, keep on coming back. -Stanley
CyborgSam Posted March 13, 2004 Posted March 13, 2004 The earliest FM I have is 6, I see you have 3, so I can't give you a sample DB. I took a screenshot, it is attached as a StuffIt/BinHexed archive. Look at it while reading: > is my name-field-to-name-field relationship set up right? Probably, but it doesn't work the way you think it does. A relationship MATCHES the two fields. So, if the Name field in Capacity is set to "Tofu", every record whose Name field in Properties is "Tofu" will match, and the portal will display just those records. If either of the two fields is empty, there is no match. > A portal establishes a one-to-many correspondence between data in the master file and data in the related file. Using the above example: the "one" is the Name field in Capacity with "Tofu", and the "many" are all the records in Properties with the Name field "Tofu". The left portal in the screenshot shows all the Properties records with "Tofu" (Capacity's Name field is set to "Tofu"). > This says to me that the "Name" field in the Capacity File's portal should itself establish the connection with the 86 "Name" fields in the Properties File without further tweaking or scripting. No? Only if all 86 names match the Name field. The relationship matches the CONTENT of the field, not the field or its name. The Capacity True to Properties True relationship is one way to ensure that any record in Capacity will match all records in Properties. This is the right portal in the screenshot. Version: v7.x Platform: Mac OS X Panther
CyborgSam Posted March 13, 2004 Posted March 13, 2004 > Where do the number globals get positioned in the Properties and Capacity Files? They do not have to appear on the layout for the portal to work. Just define them, then define the relationship. To set the global: temporarily put the field on any layout in Capacity and enter 1 in browse mode. After it's set you can remove the field from the layout. The number for True in Properties is not a global! It is a normal number field. Set it to auto-enter the value 1 and check "prohibit modification of data". Make a single step script with: Replace Contents ["True", "1"] (click the calculated result in the dialog box and then enter 1). If you always want to see all 86 records in the portal, this True relationship will work. The global field in Capacity does not need to be global, it just saves space & having to auto-enter & replace contents for all of capacity's records. One database concept you should embrace early on: Every record in every file should have a unique record number (there are very few exceptions to this rule). This is done by defining a field, e.g. RecNum, that is a number and has auto-entered a serial # with modification prohibited. Relating records this way guarantees that the relationship between any records will not break when the data in either record changes. For example: if a relationship is based on last name, changinga last name in one file without changing it in the other breaks the relationship for those records. Another advantage to using the unique # is that the actual data (e.g. last name) does not exist in both files. It resides in one file and the other uses the relationship to get the name. Does this clarify?
latestart Posted March 16, 2004 Author Posted March 16, 2004 Just a status report: I'm working on this, and it's getting clearer, but may have a couple of other questions if I can't get it sorted out... Thanks Again
latestart Posted March 16, 2004 Author Posted March 16, 2004 >> Where do the number globals get positioned in the Properties and Capacity Files? >CyborgSam: They do not have to appear on the layout. Just define them, then define the relationship. To set the global: Temporarily put the field in Capacity and enter 1 in browse mode. I set a Global field as described in the Capacity File Header, and related it to the number field in Properties. >CyborgSam: The number for True in Properties is a number field, set to auto-enter the value 1, check "prohibit modification of data". I put a number field in the Properties File, and in Options chose Auto Enter, Calculated value 1:Prohibit Modification of Value. >CyborgSam: Make a single step script with: Replace Contents ["True", "1"] (click the calculated result in the dialog box and then enter 1). If you always want to see all 86 records in the portal, this True relationship will work. Started new script
-Queue- Posted March 16, 2004 Posted March 16, 2004 Your added serial number will only be added to new records. You'll need to Replace the existing records' value with serial numbers and update the 'next' serial afterward.
-Queue- Posted March 17, 2004 Posted March 17, 2004 You don't need quotes around True; it's a field name, not a text value. That's just the way it will look in ScriptMaker's main window for the script. You don't need quotes around 1 either, since it's a number and not text. But that shouldn't cause problems either way.
CyborgSam Posted March 17, 2004 Posted March 17, 2004 > This field cannot be found Did you define a number field named True and set it to auto-enter the value 1? Note that in FileMaker 7 you cannot create a field named True (reserved word), so name it AlwaysTrue, etc. When you setup the Replace Contents, there is "Specify Field" and "Specify". In "Specify Field", select True. Click Specify, another dialog appears. Click the radio button "Replace with calculated result". Click the "Specify..." button. Type just the character 1 without quotes, click OK, click OK, etc. Does this work?
latestart Posted March 18, 2004 Author Posted March 18, 2004 Queue said: You don't need quotes around True; it's a field name, not a text value. That's just the way it will look in ScriptMaker's main window for the script. You don't need quotes around 1 either, since it's a number and not text. But that shouldn't cause problems either way. OK. CyborgSam said: Did you define a number field named True and set it to auto-enter the value 1? Yes, but field had been misnamed
CyborgSam Posted March 18, 2004 Posted March 18, 2004 Aha! The script is in the wrong file! Create the script in the file referred to by the Names relationship (the file containing the field True).
latestart Posted March 18, 2004 Author Posted March 18, 2004 Okay. Removed Script from Capacity File, put it in Properties File. Script now shows Replace [
CyborgSam Posted March 18, 2004 Posted March 18, 2004 Does the global field have the value 1 entered into it? Is the Global relationship between Global in Capacities and True in Properties? Does the portal and every field in it use the Global relationship? If all this is OK, the portal should display all the records in Properties.
latestart Posted March 19, 2004 Author Posted March 19, 2004 >CyborgSam said: Does the global field have the value 1 entered into it? Yes, entered it in browse mode. >Is the Global relationship between Global in Capacities and True in Properties? Relationship is created in Capacity File, and looks like this: Global= ::True >Does the portal and every field in it use the Global relationship? Yes, if it
CyborgSam Posted March 19, 2004 Posted March 19, 2004 Is the name field a calculation? If so, what is the calculation? Look closely at the portal and verify that the Name field does not have a border on, or over, and border of the portal. Is this doesn't work, can you post the two files here so we can examine them?
latestart Posted March 20, 2004 Author Posted March 20, 2004 Checked the portal/name field positioning, and name field calculation you listed. Here are the Files...
-Queue- Posted March 20, 2004 Posted March 20, 2004 True has no data. You need to have the field on the layout when you run the Replace script or it will not work. Add it, run the script, voila!
CyborgSam Posted March 20, 2004 Posted March 20, 2004 Queue-> Thanks, I'm sure you've found the problem. Of course, I'm kicking myself for missing something so obvious... Version: v7.x Platform: Mac OS X Panther
-Queue- Posted March 20, 2004 Posted March 20, 2004 I didn't get the obvious until I checked the file either, Sam. This was one of those real 'DOH!' moments. We never said to be sure the field was on the layout when the script was run! Look on the bright side. It only took two days to figure it out. I've overlooked seemingly insignificant but impacting details on my solutions that have taken a week to nail down. Talk about kicking oneself. I still have a mental bruise months afterward.
CyborgSam Posted March 20, 2004 Posted March 20, 2004 and it doesn't get better as you get older... I feel that my grasp of IT encompasses so much more than when I started 25 years ago. What suffers are the details. I have to have manuals & help nearby because I don't remember syntax, rules, gotchas, etc. like I did 20 years ago. My productivity on projects starts slow if I haven't used that language/app in a couple of years. I'm still remembering FileMaker things I knew a decade ago...
latestart Posted March 20, 2004 Author Posted March 20, 2004 Sam and Queue, I moved the True field from the Header of Properties File into its Body. Then I went to the Capacity File (giddy with sanguine expectation, I might add), but at first saw nothing. Then I scrolled down the page a bit to discover a new 86-row
CyborgSam Posted March 20, 2004 Posted March 20, 2004 latenight-> With friends like me, who needs enemies Something very obvious in the details that I didn't see until I checked your files. In Properties, the field True had "Prohibit modification of values" checked on (as it normally should be). The Replace Contents script step honors this setting, so it wouldn't modify True. I unchecked "Prohibit modification of values", ran the script, and rechecked it. The portal works fine. Does it now work the way you want? Sam Version: v7.x Platform: Mac OS X Panther
latestart Posted March 21, 2004 Author Posted March 21, 2004 Finally! To all of you who helped with this project, and especially to you, Sam, for your patient and persistent help, I am very grateful. (Am I the only one who wonders why these software companies expect to earn hundreds of millions off their products, yet won't invest enough to make sure that vital, basic information, such as what it really takes to set up an inter-file Portal, is available with the User's Guides? instead of the usually sketchy and inane stuff like, "The purpose of the color-picker is to help you pick colors.") EOR I've already finished programming the Capacity File, and all the relevant "Units" data for 86 properties shows up just fine. Now I'm on to sum, average and calculations fields, which shouldn't be too daunting since I have a fair amount of experience in Excel. One other thing: As I said at the start, I am a newbie both with FM Pro and with FM Forums. Is there some registry of email addresses in this site for those who wish to communicate off-forum? Thanks again...
CyborgSam Posted March 22, 2004 Posted March 22, 2004 I used to wonder why, now I begrudgingly accept unmitigated greed as the primary cause of the sorry-ass state of IT. Back when I was a bit-banger, hardware and software were changing quickly and both were exciting. Now that the bean-counters rule the IT industry, it's just about marketing & profit. Teaching Computer Science doesn't matter anymore, just programming... You can send private messages from your Profile page in the Message Box (Send PM).
Recommended Posts
This topic is 7552 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