3 Replies Latest reply on Sep 17, 2012 6:51 AM by philmodjunk

    Filter portal with drop down list or checkbox selection

    brianquillin

      Title

      Filter portal with drop down list or checkbox selection

      Post

           Trying to filter a portal - each record of the portal will contain a "season" field that displays a year (ie. 2011, 2012, etc).

           I created a field called "season_selector" containing values reflecting the same values.

           I tried to filter the portals with a calculation ' Contacts::season_selector = Items::season ' but it didn't work?

           is there a better way to do this?  what am I missing?

           thanks in advance...

        • 1. Re: Filter portal with drop down list or checkbox selection
          brianquillin

               Fixed part of it myself but now I have a new problem...

               I added a "Refresh Portal" script and set that script trigger on the ' season_selector ' field.

               If I select 2012, I see the 2012 records in the portal (same result with 2013 - which is good)

               NEW PROBLEM:

               How can I change my calculation filter statement to ALLOW BOTH SETS of records from 2012 & 2013 (or any other season selected)?

               thanks again...

          • 2. Re: Filter portal with drop down list or checkbox selection
            Sorbsbuster

                 Have two global fields, one for each year selected.  Change the filter to be

                 gYear1 = Items::season or gYear2 = Items::season

                 Or, if the second year is always the next year after the first year:

                 gYear = Items::season or gYear = ( Items::season - 1 )

            • 3. Re: Filter portal with drop down list or checkbox selection
              philmodjunk

                   Or you can use inequalities so that the two dates define a range of seasons where gYear1 is the earliest season and gYear2 is the last specified season:

                   GlobalsTable::gYear1 < Items::Season and GlobalsTable::gYear2 > Items::Season

                   And if you include gYear1 and gYear2 as fielids in the relationship (you can use the same equality or inequality operators), you won't need a script to refresh the portal. This will eliminate the need for using these fields in a portal filter expression, BTW. (Of course you can include the fields in a relationship using the cartesian join operator (X) and then still use a portal filter--without needing that refresh script, but from just what is posted so far, that seems unecessarily complicated.)