2 Replies Latest reply on Aug 11, 2010 9:40 AM by philmodjunk

    Filter portal records in FM 11



      Filter portal records in FM 11


      How to filter records in a portal with date range in FM 11 without relationship?

      I tried datefield >= $$date1 and datefield <= $$date2 but it displays records only equal to $$date1 (datefield = $$date1).

        • 1. Re: Filter portal records in FM 11

          I created a database to test out your idea of filtering a portal with global variables. I could get the portal to filter, as you've described above, but if I then changed the values of the variables, the portal would not automatically update (i.e. show the correctly filtered records) until I "modified" one of the records in the portal (by changing the value of one of the datefields in the portal, for instance). It seems that the portal can't properly "see" the variables until a change is made to a record in the portal, which causes the portal to "refresh" itself, and thus refresh the filter. Perhaps someone more knowledgable than myself can explain why it behaves like that.

          Filtering a portal with global variables seems a little strange to me anyway. I think you might be better off filtering by relationship, after all. Create two global date fields (g_date1 and g_date2) and set up the desired relationship in the Manage Database relationship graph using these global fields:

                  datefield >= g_date1
          AND datefield <= g_date2

          Then, whenever you change the values of the global date fields, the portal will always automatically update, on the fly.




          • 2. Re: Filter portal records in FM 11

            The trick is to set a script trigger on the global fields that uses Refresh Window [Flush cached join results] to refresh the filtered portal each time you modify a value one of the filtering fields.