1 Reply Latest reply on Jun 12, 2015 7:35 AM by philmodjunk

    What does this relationship mean from Adventure 1 CVLs



      What does this relationship mean from Adventure 1 CVLs


      Hi PhilModJunk!


      im studying your Adventure 1 CVLs, and found this in the Script Controlled Value List 1 -> Data Model Tab.

      This relationship is used with a basic conditional value list design to limit the values in the value list to just those from the current record.

      i like to ask if you could further explain the above quote?

      i dont understand why the "include only related values starting from" Invoice Table is used for the value, rather than the Products Table?


      How does the gProduct know to show only products in the popup menu?






        • 1. Re: What does this relationship mean from Adventure 1 CVLs

          The values that appear in this value list come from a field in Invoices, not Products. That's why "invoices" is the "starting from" Tutorial: What are Table Occurrences?.

          This method exploits a lesser known detail about return separated lists, indexing and "use values from field" value lists. If you put a list of values into a single indexed text field such as: Apple<return>Pear<return>Kiwi, a use values from field value list will list each element of the list as a separate value. If the above example were in the only record in the table, you'd get a value list of three values with each value a different type of fruit

          The script uses the text in the global search field to go and search the products table for all records containing the search text. After finding those matching records, it uses them to create such a return separated list and put it into the selected values field of the current Invoice record. That does most of what we need, but since there are multiple records in an invoices table, we need to limit our values to just those from the current invoice record.

          That's where the Invoices to Invoice|values relationship comes in. This is a "self join" relationship that matches the current invoice record to itself by primary key--the invoice record's unique identifier. Thus, the user values from field value list references SelectedValues from the Invoice|Values table occurrence with Invoice as the "starting from" table in order to limit the value list to only those values in the selectevalues field of the current record.

          You may find it helpful to put the selectedvalues field directly on the layout so that you can see how the values listed in this field match to the value list produced for the gProducts field inside the popover.

          For those reading along that might not know about the Adventure Series:

          Adventures in FileMaking #1 - Conditional Value Lists (includes details on how to set up a basic field based value list)
          Adventures in FileMaking #2 - Enhanced Value Selection (what to do when a simple value list won't cut it.)

          Caulkins Consulting, Home of Adventures In FileMaking