2 Replies Latest reply on Mar 2, 2009 3:04 PM by ray-lomas

    "go to related record" query

    ray-lomas

      Title

      "go to related record" query

      Post

      Hello,

      I've two questions, firstly can anyone recommend a good reference book which goes through scripting for filemaker? Preferably without putting one to sleep.

      My second is a scripting question.

      I have a Fault Log that I would like to "go to related record" linking back faults to pieces of equipment. The assets database that the "faults" database links back to is split into UK and US, essentially the same thing just different currency etc.

      How do I get the "go to related record" to one layout over another? Certain records want to link back to London and others to the US, I have both fields. My best guess is:

      If (Fault Log:: Office = "London")
      Go to Layout ("UK Assets - Info" (UK Assets)
      Go to related record (from table: "UK Assets"; Using Layout: "UK Assets Info" (UK Assets)
      Else If (Fault Log:: Office = "LA" or Chicago" or "New York")
      Go to Layout ("US Assets - Info" (UK Assets)
      Go to related record (from table: "UK Assets"; Using Layout: "US Assets Info" (UK Assets)
      End If

      Many thanks in advance,
      Gus

        • 1. Re: "go to related record" query
          ninja
            

          Howdy ray,

          Welcome to the Forum!

           

          If I understand correctly, I think you're already there...

           

          If (Fault Log:: Office = "London" )
          Go to Layout ("UK Assets - Info" (UK Assets)
          Go to related record (from table: "UK Assets"; Using Layout: "UK Assets Info" (UK Assets)
          Else If (Fault Log:: Office = "LA" or Chicago" or "New York" )
          Go to Layout ("US Assets - Info" (UK Assets)
          Go to related record (from table: "UK Assets"; Using Layout: "US Assets Info" (UK Assets)
          End If
          Your layout choice is stated within the go to related record command.  Your trial script did it twice which might cause some relational issues (maybe, maybe not).  One major thing to check is how your table occurences are set up so that you actually go to the record(s) you want.  I'm assuming you have FaultLog:: Office related to UKAssets:: Office and a similar relationship for the US.  If not, how do you have the relationships set up?
          Let us know how it's working...
          • 2. Re: "go to related record" query
            ray-lomas
              

            Hey,

             

            Thanks for the quick response. You cracked it, I had the Go To Related looking at the Field in the Fault table rather than the Assets.

             

            I've been scratching my head all day over that!

             

            Any suggestions of good a scripting reference guide? 

             

            Thanks again,

            Gus