5 Replies Latest reply on Apr 8, 2012 3:36 AM by MichaelLane

    Filter Portal Records



      Filter Portal Records



      I have a portal which lists clients' equipment. One of the fields is [Date_Disposed_Of]. Is it possible to have a button on the form which contains the portal to toggle between including and excluding the records where a date is in the [Date_Disposed_Of] field?

      Thanks in advance.

        • 1. Re: Filter Portal Records

          Define a global number field named gIncludeDate.

          Include it in the portal relationship like this:

          LayoutsTableOccurrence::gIncludeDate X PortalsTableOccurrence::anyfield AND
          //include the other fields that you currently use in your portal's relationship here.

          Using a global field like this with the X operator ensures that changes to the value of gIncludeDate will automatically update the filtered portal without having to use a script with the Refresh Window [flush cached join results] step.

          Now your portal filter can be:

          IsEmpty ( LayoutTableOccurrence::gIncludeDate ) or Not IsEmpty ( PortalTableOccurrence::Date_Disposed_Of]

          You can format gIncludeDate as a check box with a single custom value. You can resize the field so that only the check box is visible. Clicking the check box will filter the portal to only records with data in the field. Clearing it shows all related records.

          • 2. Re: Filter Portal Records

            Thank you - I will try this later.

            • 3. Re: Filter Portal Records

              Sorry to have taken so long to come back to you on this, and even more sorry that I do not fully understand your reply.

              The Portal takes its records from a table named [Assets] which has a [ClientID] field linked to the [ClientID] field in a table named [Main].

              Do I add the [gIncludeDate] global number field to the [Assets] table?

              You state:-

              "LayoutsTableOccurrence::gIncludeDate X PortalsTableOccurrence::anyfield AND
              //include the other fields that you currently use in your portal's relationship here."

              I have no experience of LayoutsTable Occurrence so further guidance / explanation would be very much appreciated.




              • 4. Re: Filter Portal Records

                Hey Michael,

                Maybe this will help you:

                I was interested in trying this out and is seems to work nicely.

                Pretty clever PhilModJunk,

                I did however have to reverse your filter. (atleast replace the "not" part)
                Otherwise is was only showing the items that were disposed of.

                Turned out is was:

                not IsEmpty ( Main::gIncludeDate ) or IsEmpty ( Assets::DateDisposedOf )

                • 5. Re: Filter Portal Records

                  Many thanks to both PhilModJunk and DaSaint for their assistance. Using input from both of you I have achieved the desired result.