3 Replies Latest reply on Dec 21, 2009 8:09 AM by philmodjunk

    Filtered portal records base on two criteria...

    trend7

      Title

      Filtered portal records base on two criteria...

      Post

      Hi all,

       

      I have read the forum regarding showing filtered data/records in a portal by using a global variable and setting the relationship between the parent and children table. For instance, if my portal shows a list of suppliers of various product, and by setting the global variable to the name of the supplier, say "ABC Supplier", the portal will show me the products made by "ABC Supplier" only.

       

      However, what should I do if I want the portal to show not just "ABC Supplier" but also "XZY Supplier"? 

       

      Thanks in advance.

       

      Regards,

      TM 

        • 1. Re: Filtered portal records base on two criteria...
          philmodjunk
            

          Two methods:

           

          1) make your global a repeating field and store a different value in each repetition

           

          2) store both names in the same field separated by a carriage return.

           

          An easy way to implement option 2 is to format your global field with a check box format. If you click several check box values, filemaker stores those values in the field as text separated by carriage returns.

          • 2. Re: Filtered portal records base on two criteria...
            trend7
              

            Thanks Phil. And it solved my problem.

             

            However, I am facing another problem now. Let's say I have two tables. Table 1 has an ID field and a name1 field. Table 2 has an ID field and name2 field. The relationship between Table 1 and Table 2 is linked by the ID field in that Table1:ID---=---Table2::ID.

             

            Now if I key in a "ABC" in Table1::name1 (for Table1::ID = 1) and then I key in "1" in Table2::ID, then Table2::name2 will show me "ABC". But when I change the name from "ABC" to "XYZ" in Table1::name1 (for Table1::ID = 1), Table2::name2 will continue to show me "ABC". How can I make Table2::name2 also give me "XYZ" without any script?

             

            I tried to set Table2::name2 as Table1::name1 in calculation field and it will work, however, the portal will not show the required name field despite I have joined the name field to another global field. 

            • 3. Re: Filtered portal records base on two criteria...
              philmodjunk
                

              Since you've defined a relationship based soley on the ID fields, any values you have in the name fields are ignored.

               

              You need both pairs of fields declared as match fields in your relationship:

               

              Table1:ID = Table2::ID AND

              Table1:name1 = Table2::name2

               

              You can edit the existing relationship by double-clicking the line linking the two table occurrences.

               

              Now the records will not match unless both name and ID fields contain matching values.

              Note: If you use your relationship for more than just this one filtered portal, you may need two separate relationships, one that matches soley by ID values and one that filters by name.

               

              Many folks get confused over the terms Table and Table Occurrence. To learn more, click the following link:

              Table vs. Table Occurrence (Tutorial)