1 Reply Latest reply on Mar 1, 2012 9:30 PM by philmodjunk

    Help filters on portal



      Help filters on portal


      Hello I would like some help in setting up a filter for a portal. I have a layout called "Reporte clientes" inside of it there´s a portal for the "Callbookitems" table (which is two tables away in the relationship). What I want is users to put name of the customer and month of the year, and that the portal shows all of the information related to the customer selected and to the month selected as well. I got it runing with customer selection (which is the parent key) but I cant add the month field as a filter that works over the portal. If some one is so kind to explain how to do it... I have tried with a global field but I dont know how to set up the relationship... Attached to this post there´s a screen shot of the relationship graph..


        • 1. Re: Help filters on portal

          Each "box" in your screen shot is called a "table occurrence". Make a new table occurrence of callbookitems.

          In Manage | Database | relationships, make a new table occurrence of callbookitems by clicking it and then clicking the duplicate button (2 green plus signs). You can double click the new occurrence box to get a dialog to appear where you can rename the new occurrence box to Selectedcallbookitems.

          We have not duplicated a table. Instead, this is a new reference to the same table already present in your database.

          Add it to your relationships like this:

          LineItems::SAP = Selectedcallbookitems::SAP AND
          LineItems::gMonth = Selectedcallbookitems::month

          Define gMonth in the LineITems table but give it global storage.

          Make your portal a portal to SelectedCallbookItems instead of callbook items.

          With this relationship, no portal filter is needed to do what you want, but you may want a more sophisticated filter action. If so, you can use this relationship:

          LineItems::SAP = Selectedcallbookitems::SAP AND
          LineItems::gMonth X Selectedcallbookitems::anyField

          In this case, you might use a portal filter expression such as:

          IsEmpty(Month) or ( LineItems::gMonth = SelectedCallbookItems::Month )

          With this expression, you'll see all the call book items until you specify a month in the global field. It will also be possible to modify this expression so you can specify a year as well as a month so that selecting the Month of January doesn't pull up records from January, but from different years.