1 Reply Latest reply on Apr 3, 2012 3:03 PM by philmodjunk

    Listing Related Records

    VanessaWeller

      Title

      Listing Related Records

      Post

      I am a Filemaker Pro novice, so I imagine there is probably a reasonably simple answer to this question, but I could really use some help figuring it out.  I have a database that contains two tables--one dedicated to storing "Sources" for a documentary, and another dedicated to "Contact" information.  I have made the tables related through the Contacts::Last Name field and the Sources::Keywords field.  I want to be able to show a list on the Contacts layout of related records in the Sources table, but I need this list to be unique for each record in the contacts table.  In other words, I want to show what specific sources are related to each specific contact.  I cannot figure whether I should try to do this through a filtered portal, or if I should set a script trigger for a set field.  I was able to create a button on the Contact layout that enables users to view related Source records--it uses this script:

      Set Variable [$name; Value:Contacts::LastName]

      Go to Layout ["Sources" (Sources)]

      Enter Find Mode[]

      Set Field [Sources::Keyords; $name]

      Perform Find[]

      Go to Related Record [Show only realted records; Match found set; From table: "Sourcs"; Using layout: "Sources" (Sources)]

       

      This script works like a charm.  Is there some way to modify it to simply list the Names of the Related Record?  Or should I try listing them through a portal? 

        • 1. Re: Listing Related Records
          philmodjunk

          A Portal to Sources will list all related sources records for the given contact, but you should rethink using last names as the match field in the relationship. What will you do if you get two contacts named  "Smith"? What will you do when Mary Jones changes her name to Mary Smith? Or you find out after the fact that Jim Smith is really Jim Smythe?

          I suggest defining an auto-entered serial number in contacts and using it to link to records in your sources table.

          PS. in your script, if you remove the Go to Related Records step, you'll still get the same results.