4 Replies Latest reply on Apr 28, 2013 3:15 PM by Fryx

    Portal filtering



      Portal filtering


           Portal filtering seems like the perfect answer to a problem I'm having, but I can't get it to work--I'm probably missing something obvious. I have a portal in a database called Invoices that displays records from a database called AdSales. We now have more sales for some customers than can comfortably display, so I want to show only recent sales (while retaining the amounts for the current balance that also reflcts payments from another portal). So I tried a portal filter like this:

           AdSales::Issue > 2-1-13

           Each monthly "Issue" is a date field (1-1-13, 2-1-13, etc.). So I THOUGHT this would hide the January and February sales. But when I save and view an invoice, nothing has changed. What am I doing wrong?

        • 1. Re: Portal filtering

               In order for a filter to work you need to create a calculation with a bolean result.

               Meaning that the calculation is either true or false.

               A value other then "0" is considered True.

               "0" or no value at all is considered False.

               So what you need to come up with is an expression that is either true or false (either 1 or 0)

               For instance:

               If ( PortalTable::Date  > Get ( CurrentDate ) - 60 ; "1" ; "" )

               This expression means that if the date in the portal is larger than 60 days ago it will be "True" otherwise it will be "False".

               An expression like that will work as a filter.

               I hope this makes sense.

          • 2. Re: Portal filtering

                 Thanks, yes. So all those instances for which the result is TRUE will display?

            • 3. Re: Portal filtering


                   Now remember that this will be evaluated per portal record. So that's why you need to use the date field from the Table Occurrence that the portal is based on.

                   You can see this when you double click the portal it says on the top "Show related records from..."

                   That's the table occurence you need to point to.

                   So if that says: "AdSales" You need to use the Date field from AdSales in your filter calculation.

                   But I'm sure you got that one.

              • 4. Re: Portal filtering

                     Yes, and it works--thanks.