1 Reply Latest reply on Mar 20, 2012 9:42 AM by philmodjunk

    Date range within a portal!

    andy@the-wod.co.uk

      Title

      Date range within a portal!

      Post

      Hi.

      I have a seies of records in a table called "sessions purchased". I have created a table and layout caled "finacial report" to display records from that table within a portal. The date range of the records show is defined by a "date from" and a "date to" field in the "financial report" table.

      I have in the "filter portal records" the following

      (Sessions Purchased::Sessions Purchased date ≥ Financial Reporting::From Date) and (Sessions Purchased::Sessions Purchased date ≤ Financial Reporting::To Date)

      I cannot get anything to display in the portal. I know my problem I think is that I am not getting any related records from the "sessions purchased" table. I want to read the mall in then use the "filter portal records" to display just what I need. I can then change the dates in the "date from" and a "date to" fields to unpdate and display a different set of records in trhe protal.

      Does this make sense, is this thre right way to go about it?

      Thanks for any help.

      Andy

        • 1. Re: Date range within a portal!
          philmodjunk

          What is the relationship on which the portal is based? I'd remove the portal filter as a test and make sure the expected records appear in the portal.

          Getting a portal filter controlled portal to update correctly when a filter value is changed can be something of a challenge, but it can be done--thanks to a method shared here by Mark Gores:

          Let's say you have this relationship for your portal:

          Financial Reporting::anyField X Sessions Purchased::anyField

          This will list all records from Sessions Purchased in your portal. YOu might well have a different relationship here but let's use this for our example.

          This will work with your portal filter, provided the three fields are all of type data, but changing a value i one of the Financial Reporting date fields won't update the portal without a script using the undesirable Refresh Window [Flush cached join results] script step.

          Here's a relationship you can use that will update automatically:

          Sessions Purchased::Sessions Purchased date X Financial Reporting::anyfield and
          Sessions Purchased::Sessions Purchased date X Financial Reporting::anyfield

          Or you could completely dispense with a portal filter expression and just use this relationship for your portal:

          Sessions Purchased::Sessions Purchased date ≥ Financial Reporting::From Date and
          Sessions Purchased::Sessions Purchased date ≤ Financial Reporting::To Date

          If there is an addition pair of fields needed in your portal relationship, you can add them to either of these two relationship options.

          Note: to show all records when there is no date specified in the from and to fields, use the first option and use this portal filter expression:

          IsEmpty ( Financial Reporting::From Date ) or (Sessions Purchased::Sessions Purchased date ≥ Financial Reporting::From Date and Sessions Purchased::Sessions Purchased date ≤ Financial Reporting::To Date)