2 Replies Latest reply on Feb 27, 2017 6:58 AM by user25183

    Change filter in portal

    user25183

      Hi

       

      I have a portal showing related records, by default it should show all related records, then selection should change using one of three choices ; date, type or all.

       

      I look the example (projects) provide the FilterPortal records

      If ( $$SHOW_TASKS = "My Tasks" ; PatternCount ( Tasks::RESOURCE ID MATCH FIELD ; $$CURRENT_USER ) ; 1 )

       

      That might work on a two choice (All and User),

      I'm looking on doing it for there choices (All, a date and a type)

       

      Can't change the FilterPortal records using a script that would be too simple!

       

      Is it possible or just too complicated?

        • 1. Re: Change filter in portal
          DavidJondreau

          It looks like you're using a global variable instead of a global field to select the values. I'm not sure how that's being set. Here is a calculation pattern that could help:

           

          Let ( [

          date.choice = thisTable::gDateSelect ;

          date.target = relatedTable::DateField ;

          date.result = If ( not isEmpty ( date.choice ) ; date.choice = date.target ; 1 ) ;

           

          type.choice = thisTable::gTypeSelect ;

          type.target = relatedTable::TypeField ;

          type.result = If ( not isEmpty ( type.choice ) ; type.choice = type.target ; 1 ) ;

           

          result = date.result AND type.result

          ];

          result

          )

          • 2. Re: Change filter in portal
            user25183

            Hi David

            First the calculation come directly fro the Projects example of Filemaker.

             

            Your calculation I put in the script or the portal Filterrecords?