5 Replies Latest reply on Sep 17, 2014 10:05 AM by NaturSalus

    GTRR goes only to the first related record

    NaturSalus

      Title

      GTRR goes only to the first related record

      Post

      Hello,

      My project manages customer complaints.

      Each complaint record has different sections and in some of them it is possible to  create one or more Support Item records. So for instance, there are support items in:

             
      • the complaint description section
      •      
      • the complaint reply section

       

      A support item is a container field holding: an image, a document, or a pdf file.

      All the support items are kept as records in the SupportItem table.

       

      Support item records are created through scripting from the Complaint_Detail layout based on the Complaint TO.

      Every time that a new support item record is created a relationship is established between three records:

             
      • the current Complaint record,
      •      
      • a related Complaint|SupportItem record
      •      
      • a related SupportItem record

       

      I have double checked that both records and relationships are correctly established.

      As mentioned before, a new Support Item record can be created from different sections of the current Complaint record. To distinguish from a support item created at the complaint description section from another created at the complaint reply section, the ItemLocation field is created and kept in the corresponding Complaint|SupportItem record.

      I can visualize the SupportItem records created in the Description and Reply sections of the current Complaint record  through portals to the Complaint|SupportItem TO filtered by the ItemLocation field (Complaint Description or Complaint reply).

       

      My problemis that when I try to go from the current Complaint record to its related SupportItem I can only get the first SupportItem that was created, no matter:

             
      • from which  Complaint section (description or reply) it was created.
      •      
      • what is the related SupportItem record I want to go to. For example, I want to go to the the third created SupportItem record that is related to the current Complaint record.

       

      I don't get any error message either when setting the GTRR or when getting the result (suppot item record related to the current complaint record).

      GTRR settings are shown on attached image.

       

      TABLES

      Tables:

             
      •      

        Complaint

             
      •      
      •      

        SupportItem

             
      •      
      •      

        Complaint|SupportItem

             

       

      RELATIONSHIPS

      Compaint TO --< Complaint|SupportItem TO >-- SupportItemForComplaint TO

      Note: I must say that the SupportItem table is also related to other tables but in each case a different TO is used, for example: Deviation TO --< Deviation|SupportItem TO >-- SupportItemForDeviation TO

      Although I don't think that this has any effect on the issue reported here

       

      Since:

             
      • records are correctly created
      •      
      • record relationships are established as expected
      •      
      • no error messages when setting up the GTRR script
      •      
      • GTRR only returns the first SupportItem record created, no matter where it was created or what related record you are looking for

       

      my error must be conceptual, but I can't figure it out. 

       

      Thanks

      GTRR.jpg

        • 1. Re: GTRR goes only to the first related record
          philmodjunk

          Are you using a button in the portal to  to perform the GTRR?

          You might need to do a two stage GTRR: GTRR to Complaint|SupportItem TO and then GTRR to SupportItemForComplaint TO

          Caulkins Consulting, Home of Adventures In FileMaking
          • 2. Re: GTRR goes only to the first related record
            NaturSalus

            Hello Phil,

            Thanks for looking to my question

            Are you using a button in the portal to  to perform the GTRR?

            Yes.

            You might need to do a two stage GTRR: GTRR to Complaint|SupportItem TO and then GTRR to SupportItemForComplaint TO

            I see what you mean. I`ll try to see how it goes.

            Thanks,

             

             

             

            • 3. Re: GTRR goes only to the first related record
              NaturSalus

              It seems that although I understood what you said, I am not implementing it right.

              The script triggered by the button on the portal is:

              Go from complaint to related support item record

              # Error Handling
              Allow User Abort [ Off ]
              Set Error Capture [ On ]
              #
              Go to Related Record [ From table: “Complaint|SupportItem” ; Using layout: “dev_Complaint|SupportItem” (Complaint|SupportItem) ]
              [ Show only related records ]


              Go to Related Record [ From table: “SupportItemForComplaint” ; Using layout: “SupportItem_Detail” (SupportItem) ]
              [ Show only related records ]

              If [ SupportItem::ItemType = "Document" ]
              Go to Object [ Object Name: "sDocument" ]
              Else If [ SupportItem::ItemType = "Image" ]
              Go to Object [ Object Name: "sImage" ]
              Else If [ SupportItem::ItemType = "pdf" ]
              Go to Object [ Object Name: "spdf" ]
              End If

              Is this way to do what you suggested?

               

              • 4. Re: GTRR goes only to the first related record
                philmodjunk

                Assuming that the table occurrence names in parenthesis are the table occurrences in your relationships map, yes.

                If you have FileMaker Advanced, you might check this in the script debugger, maybe there's a triggered script that's interfering. If you don't, you might put a show custom dialog step after each GTRR script step to see if each is working correctly.

                • 5. Re: GTRR goes only to the first related record
                  NaturSalus

                  When using the script debugger I found out my mistake.

                  My fault, I had modified the Go from complaint to related support item record script and I was trying it on the Deviation table without having modified its GTRR script previously.

                  It works perfectly well!smiley

                  I thought that FMP could get directly from Complaint  TO to the SupportItemForComplaint TO. So, it never occurred to me that you could use a two stage GTRR. Great hint!

                  Many thanks again.