1 Reply Latest reply on Jan 24, 2012 3:18 PM by philmodjunk

    List function equivalent in FM 8



      List function equivalent in FM 8


      I have a calc field that is the "list" -List(field)- of all the related ::note fields for a certain record. Problem is that for FM 8 which is what I am running this function does not exist. Any Ideas how to get around this? I would like to put all the related notes onto a print layout.

      I thought of using a portal with no borders. Looking for something more elegant



        • 1. Re: List function equivalent in FM 8

          I would like to put all the related notes onto a print layout.

          when printing related records from a portal in nearly any version of Filemaker, it's often best to switch to a layout based on the portal's table and use list view with fields from the parent record placed in headers and summary layout parts. That's how the invoices starter solution prints out the line items for an invoice if you want to see an example.

          Whether you use a portal or all the notes combined in a single field, you are up against an upper limit set in the design of your layout. You can only set a very large size to the field or portal and set it to slide up and resize the enclosing part, but you can't expand the size of the field or portal. Once you get so much data that it no longer "fits" the extra data won't show.

          That said, you could use a script that loops through the related records to merge all the notes data into a single field:

          IF [Not IsEmpty ( Notes::ForeignKeyField ) //check for related notes records]
              Go To Related Record [Show only related records; From table: Notes; Using layout: "Notes" (Notes)]
                 Set Variable [$NoteList ; value: $NoteList & ¶ & Notes::NoteText ]
                 Go To record/request/page [next ;exit after last]   
              End Loop
              Set Field [ParentRecord::NoteList ; Right ( $NoteList ; Length ( $NoteList ) - 1 ) ]
              Go to layout [original layout]
          End If

          Use your actual table and field names in place of mine. I'm assuming that FM 8 supports variables. If not, use a global field in place of the variable.