May 28, 200520 yr On a single file with two tables, the first table becomes the default(current). How can I switch to the other table? If I create a =relationship between 2 tables, how can I add records into the related table via script? This done easily using 2 related files but I can't figure out how to do it on 2 related tables(on a single file). Any light would be highly appreciated. Thanks in advance, Garry
May 28, 200520 yr Create a layout which are using the other table (created automaticly when you created your table) If you create a new layout, have a look in the "layout setup" for "show records from" and choose the other table GoToLayout ["other layout" (other table)] NewRecord/Request (+ GoToLayout[original layout]
May 28, 200520 yr Alternatively, you might consider creating records in the other table without ever leaving the layout for your default table. This is done by setting up a relationship with the 'Allow creation of records via this relationship' option enabled and then writing a value into a field in the other table. You can either use a portal to do this, or you can set up a utility relationhip to the other table which is based on a global field in the current table. In the latter case, your script (or your user) should first place a (unique) value into the global field and then place a value into a related field - whereupon a new related record will be created.
May 29, 200520 yr Here is an example of creating new records in a related table without the use of a script. (Courtesy of "Using Filemaker 7" A great book btw.) Using a utility relationship and the appropriate auto-enter option for the foreign key fields in the "many" table, you can place the related fields on the "one" layout and use them to create a new child record by filling them in and committing the record. The cool part is how the fields clear themselves automatically after the commit by resetting the temporary foreign key. HTH, Dana test.fp7.zip
May 29, 200520 yr Althoug I would vote for movement of the entire thread, is there yet another way - that have existed the last 9-10 years, after an upgrade to 3.0: http://www.filemakerpros.com/Related_Match_Field.zip Which is a cool variation over 'Allow creation of records via this relationship' Ray mentions, because if you have buttons in a portalrow will they not dangle in empty records, the scripting as such is pretty simple: Go To Portalrow [Last] Go To Portalrow [Next] --sd
Create an account or sign in to comment