retropia Posted August 29, 2002 Posted August 29, 2002 Hi . . . I appreciate all of the useful info shared in these pages. Between hints here and many calls to the psychic hot line, I'm making progress with my FileMaker site. I'm new to FileMaker; just loaded v.5.5 a week ago. All's been going well, but I'm hitting a wall and could use some help. Our car club database is in two related FM files, FinRost2 and FinCars2. They're related via the record number FM automatically assigns to each record. In the FinRost2 database, the member car list shows in a portal in the primary FinRost2 member record. You can edit the existing list of member cars, or there's a new blank record at the bottom of the list always waiting to add another car, already with the record number assigned to relate the new car record back to FinRost2. I need for the website to accomplish the same thing, one way or another. Pulling up and editing the existing record, including the existing cars showing in the portal, seems to be working fine. But I'm not having any luck getting a new related record in the portal to work. One way it appeared to work, adding a new car record to the bottom of the list. Then when I went to "refresh," it showed that it had deleted all of the previous car files. That's not right! What I'm getting with the coding shown below is "Your attempt to edit a record failed because of the following: Missing join value for creating related record." I thought that maybe if I put the "add new car" function in a separate FMP-portal or separate "form" it might work better, since it's really an add new record, and not an edit. I've pulled the record number into the add new record section, and it shows, so I'd think that would provide the "join value for creating related record." And it did provide the relation in the earlier version where it deleted all of the other records. Here's the pertinent code (the "add new car" section is near the bottom) <html> <head> <title>Member Record</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#CCFFCC"> <P> <FORM ACTION="FMPro" METHOD="post"> <P> <INPUT TYPE="hidden" NAME="-RecID" VALUE="[FMP-currentrecid]"> <INPUT TYPE="hidden" NAME="-db" VALUE="FinRost2.fp5"> <INPUT TYPE="hidden" NAME="-lay" VALUE="Layout #1"> <INPUT TYPE="hidden" NAME="-format" VALUE="lcci_pages/editreply.htm"> <P> <div id="Layer1" style="position:absolute; width:153px; height:25px; z-index:1; left: 18px; top: 16px"><font size="4" color="#FF3366"><b><font face="Arial, Helvetica, sans-serif">Member Record </font></b></font></div> <div id="Layer2" style="position:absolute; width:200px; height:115px; z-index:2; left: 173px; top: 16px"><img src="../lcci_images/logocolorclosed1,5wide.gif" width="188" height="120"></div> <div id="Layer3" style="position:absolute; width:90px; height:20px; z-index:3; left: 18px; top: 136px"><b><font size="3" face="Arial, Helvetica, sans-serif" color="#FF3366">First Name</font></b></div> <div id="Layer4" style="position:absolute; width:225px; height:35px; z-index:4; left: 18px; top: 161px"> <input type="text" name="FN" VALUE="[FMP-field: FN]" size="35" maxlength="35"> </div> <div id="Layer5" style="position:absolute; width:85px; height:20px; z-index:5; left: 248px; top: 136px"><font color="#FF3366"><b><font size="3" face="Arial, Helvetica, sans-serif">Last Name </font></b></font></div> <div id="Layer6" style="position:absolute; width:200px; height:35px; z-index:6; left: 248px; top: 161px"> <input type="text" name="LN" VALUE="[FMP-field: LN]" size="35" maxlength="35"> </div> <div id="Layer19" style="position:absolute; width:140px; height:30px; z-index:19; left: 383px; top: 16px"> <font face="Arial, Helvetica, sans-serif" color="#FF3366"> <input type="submit" name="-edit" value="Submit Changes"> </font></div> <div id="Layer20" style="position:absolute; width:40px; height:20px; z-index:20; left: 18px; top: 411px"><font color="#FF3366"><b><font face="Arial, Helvetica, sans-serif" size="3">Cars</font></b></font></div> <div id="Layer21" style="position:absolute; width:540px; height:75px; z-index:21; left: 18px; top: 536px"> [FMP-Portal: FinCars2] <tr> <td valign="top" align="right"> <input type="text" name="FinCars2::YEAR.[FMP-CurrentPortalRowNumber]" VALUE="[FMP-Field:FinCars2::YEAR]" size="4" maxlength="4"></td> <td valign="top" align="right"> <input type="text" name="FinCars2::MAKE.[FMP-CurrentPortalRowNumber]" VALUE="[FMP-Field:FinCars2::MAKE]" size="15" maxlength="15"></td> <td valign="top" align="right"> <input type="text" name="FinCars2::MODEL.[FMP-CurrentPortalRowNumber]" VALUE="[FMP-Field:FinCars2::MODEL]" size="25" maxlength="25"></td><br> </tr> [/FMP-Portal] </div> </form> <FORM ACTION="FMPro" METHOD="post"> <P> <INPUT TYPE="hidden" NAME="-RecID" VALUE="[FMP-currentrecid]"> <INPUT TYPE="hidden" NAME="-db" VALUE="FinRost2.fp5"> <INPUT TYPE="hidden" NAME="-lay" VALUE="Layout #1"> <INPUT TYPE="hidden" NAME="-format" VALUE="lcci_pages/addnewcar.htm"> [FMP-Portal: FinCars2] <div id="Layer22" style="position:absolute; width:100px; height:28px; z-index:22; left: 63px; top: 401px"> <input type="submit" name="-new" value="Add New Car"> </div> <div id="Layer23" style="position:absolute; width:545px; height:70px; z-index:23; left: 18px; top: 446px"> <tr> <td valign="top" align="right"> <input type="text" name="FinCars2::YEAR" VALUE="" size="4" maxlength="4"></td> <td valign="top" align="right"> <input type="text" name="FinCars2::MAKE" VALUE="" size="15" maxlength="15"></td> <td valign="top" align="right"> <input type="text" name="FinCars2::MODEL" VALUE="" size="25" maxlength="25"></td><br> <td valign="top" align="right"> <input type="text" name="FinCars2::NUMBER" VALUE="[FMP-Field:FinCars2::NUMBER]" size="5" maxlength="5"></td><br> </tr> </div> [/FMP-Portal] </form> </body> </html> Anyway, thanks in advance if anyone can help. Now it's time to take out the trash and drag myself to bed.
Jeff Spall Posted August 29, 2002 Posted August 29, 2002 Hi, I think to make the new related record from that page is actually much easier than the code you have there. "NUMBER" is the key field for the relationship right? Your form should post direct to the FinCars2 db like this: <FORM ACTION="FMPro" METHOD="post"> <INPUT TYPE="hidden" NAME="-db" VALUE="FinCars2.fp5"> <INPUT TYPE="hidden" NAME="-lay" VALUE="Layout #1"> <INPUT TYPE="hidden" NAME="-format" VALUE="lcci_pages/addnewcar.htm"> <INPUT TYPE=hidden NAME=NUMBER VALUE="[FMP-Field:NUMBER]"> <INPUT TYPE=text NAME=YEAR VALUE="" SIZE=4 MAXLENGTH=4><BR> <INPUT TYPE=text NAME=MAKE VALUE="" SIZE=15 MAXLENGTH=15><BR> <INPUT TYPE=text NAME=MODEL VALUE="" SIZE=25 MAXLENGTH=25><BR> <INPUT TYPE="submit" NAME="-new" VALUE="Add New Car"> </FORM> Remember, the current format page is showing records from FinRost2.fp5, so that embedded field [FMP-Field:NUMBER] is coming from FinRost2.fp5, but you're posting the form direct to FinCars2.FP5. The fields in the form don't need the relationship names. Watch that 'CurrentRecId" - the one showing would be from FinRost2. Ouch. regards, Jeff
retropia Posted August 29, 2002 Author Posted August 29, 2002 Jeff, thanks! It works great. My hang-up was I thought it had to appear the same as the database in order to work, thus I wanted the "new car add" function to be in the portal. But, since both databases are by necessity open, there's no reason why I can't make the addition directly to the pertinent database. It is easier. Of course, the only way it would work is if there was the relation connector, which is what I thought I was doing with the "CurrentRecId" tag. That apparently was a problem. I would have never thought of using: <INPUT TYPE="hidden" NAME="NUMBER" VALUE="[FMP-Field:NUMBER]"> to bring the connecting record number from FinRost2 to this FinCar2 form. It did the job. The only other thing I had to do was make sure that the FinCars2 layout in FileMaker that automatically opens, when I open FinRost2, was the "Layout #1" that I named in the code. I did this by going to the FinCars2 "Preferences," "Application," then choosing which layout to force open when the file opens. I'll end with a tip for some other struggling newbie that took me awhile to figure out on my own. The CDML tag [FMP-Portal] says (in the reference) to use the syntax: [FMP-Portal: Relationship name]. But it doesn't really explain what it means by "relationship name." Does it mean it wants the name of the secondary, or connected, database? I tried "FinCars2.fp5" and it didn't work. Does it want "secondary" or "child" or the words "relationship name"? Nothing worked. Finally, I tried "FinCars2" without the filename extension ".fp5" and that worked! Maybe this wouldn't give anyone else grief, but it puzzled me. Thanks again for the assistance!
Recommended Posts
This topic is 8191 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