1 2 Previous Next 16 Replies Latest reply on Feb 12, 2014 4:00 PM by philmodjunk

    Filtering A Portal

    DV

      Title

      Filtering A Portal

      Post

           I am trying to filter a portal to only display records that are checked in a check box.

            

           I have put the following in the filter calculation:

           Event Elements::Contract_Tick Box="1"

           The checkbox is linked to a value list with 1 as an option.

            

           The layout that displays the portal in in table 1. I want data from table 2 to appear when the check box is selected.

           Check box is a field in table 1.

            

           For some reason its not working. I had it working but it has stopped

           Any ideas?

        • 1. Re: Filtering A Portal
          philmodjunk

               Is "1" the only check box value or are their other values that you can select?

          • 2. Re: Filtering A Portal
            DV

                 Yes, 1 is the only value.

                 it now will display one record that is tselected via the checkbox, ut I need it to display multiple.

                  

                 it was working but now I'm not sure what has happened.

            • 3. Re: Filtering A Portal
              philmodjunk

                   Has 1 always been the only value entered into this field for each of your portal records? (a change in the value list can hide previous values from view if they are no longer part of the defined value list.)

                   Is "Event Elements" the exact text selected from the "show related records from" drop down in portal setup...?

                   What do you get if you completely remove the portal filter? Do the results that you see in the portal match what you would expect to see if the portal didn't limit the records to just those with the check box selected? (This checks the underlying relationship defined for the portal.)

              • 4. Re: Filtering A Portal
                DV

                     1 has always been the value entered in the field.

                     When there is nothing filtered it doesn't show anything.

                     When it is filtered with Event Elements::Contract_Tick Box= "1" it will show one item in the portal but not all of the selected items.

                     Any ideas on how to get it to show more than just one selected element if more than one is selected?

                      

                      

                      

                      

                • 5. Re: Filtering A Portal
                  RickWhitelaw

                       Perhaps take out the  "=1" out of the equation.

                  • 6. Re: Filtering A Portal
                    philmodjunk

                         Sorry, but these two statements:

                         

                              When there is nothing filtered it doesn't show anything.

                         

                              When it is filtered with Event Elements::Contract_Tick Box= "1" it will show one item in the portal but not all of the selected items.

                         Contradict each other.

                         A Portal filter expression takes the related records that would otherwise appear in your portal and further limits what records are allowed to appear in the portal. It cannot add records to what would appear if the portal were unfiltered it can only omit them. Since an unfiltered version of the portal is empty, there is nothing for a portal filter expression to filter. This would suggest problems with your relationships--or possibly the design of your layout.

                    • 7. Re: Filtering A Portal
                      DV

                           Hi there,

                           I'm getting closer to solving this.

                           Do you have a script so that:

                           If I check 1 box in a portal, it will automatically select all the relating records?

                           ie: If one line in the schedule is selected, all other relating lines in the schedule also get selected so they will all appear and not just the first line?

                           Ideally with the ability to manually untick if required so it won't appear...

                      • 8. Re: Filtering A Portal
                        philmodjunk

                             Can you describe what you want in more detail? What do you mean by "all the relating records?" What makes them related?

                        • 9. Re: Filtering A Portal
                          DV

                               So there are two tables.

                               1. Event Elements

                               2. Schedules

                               There are multiple schedule lines linked to an event element.

                               Event element is linked to schedule via an ID number.

                                

                               When an event element is checked, I want all lines of the relating schedule lines to appear.

                               At the moment only the first line will appear.

                                

                               My thought is that if I set up a script along the lines of:

                               When 1 check box in event element is ticked, a check box in schedule for all lines is ticked.

                               When event element is unticked, all lines in the schedule are unticked.

                                

                               Is this helpful? Is this the best way to go about it?

                          • 10. Re: Filtering A Portal
                            philmodjunk

                                 Your relationship appears to be:

                                 Event Elements-----<Schedules

                                 

                                      When an event element is checked, I want all lines of the relating schedule lines to appear. At the moment only the first line will appear.

                                 But I see no purpose to that. Your match fields would appear to be similar to this:

                                 EventElements::__pkEventElementID = Schedules::_fkEventElementID

                                 And all the "related schedules records" should automatically appear in an unfiltered portal. There should be no need to click any check box. By definition, a record in Schedules is related to the current EventElements record if the values match in the two ID fields and the records will appear in the portal. If they don't match, they aren't related and the schedules record should not appear in the portal.

                                 Is it possible that one Record in Schedules needs to be linked to more than one EventElement record?

                            • 11. Re: Filtering A Portal
                              DV

                                   Each schedule is unique to each event element.

                                   Without filtering all of the schedule lines will appear in the portal.

                                   What we need though is only certain elements and their related schedule lines to display....

                                    

                                   When I was selecting the event element check box field in the event element table it would select the one I wanted.

                                   When I put the field on the portal linked to the schedule table, every checkbox was selected and not just the ones linked to the event element - i feel this is now the problem...

                                   When I un select an element, all schedule lines dissapear.

                                   When I selected an element, all schedule lines appear but not just the specific event element schedule lines, all of them.

                              • 12. Re: Filtering A Portal
                                philmodjunk
                                     

                                          Without filtering all of the schedule lines will appear in the portal.

                                     Does that mean that an unfiltered portal shows all fo the schedule lines for a given event? Last time I asked you to check this, you indicated that your portal was empty. This is a critical detail.

                                     

                                          When I put the field on the portal linked to the schedule table, every checkbox was selected and not just the ones linked to the event element - i feel this is now the problem...

                                     That suggests that something is not correct in your layout design. Clicking check box in one record will not automatically select the check box in all records or all related records. If you see this, chances are that you are modifying a single field in a single record, but an issue with your layout design could easily create the illusion that this is the case. Then your portal filter expression will only show a single record because none of the other records actually have a selected check box.

                                     

                                          When I un select an element, all schedule lines dissapear.

                                     

                                          When I selected an element, all schedule lines appear but not just the specific event element schedule lines, all of them.

                                     I just reviewed your original post in the light of your more recent ones. You are modifying a field in Event Elements instead of Schedules. Thus your portal filter is True for all related records if the check box is selected or false for all related schedule records if it is not. You need to be modifying a field defined in Schedules and your portal filter should be modified to test the value of a field in the portal's table instead of the layout's.

                                     And your basic interface design seems strange. In order to click a check box to select a schedule record, you need a portal that shows all related Schedules records or they won't be visible to select. But then you want a portal that only shows the selected records. That can't be the same portal, you'd have to use two portals, one unfiltered for selecting records and one filtered for showing just the selected ones.

                                • 13. Re: Filtering A Portal
                                  DV

                                       Thank for your help.

                                       The two different portals are set up.

                                       I set up the checkbox to come from schedule so now it works to display the schedule item.

                                       It does however only display one of the schedule items not all of them.

                                       Ideally a user will select one check box the corresponding schedule will display.

                                       What the user would need to do currently is select every schedule line individually to appear...is there a way around this?

                                       I feel the end is close!

                                  • 14. Re: Filtering A Portal
                                    philmodjunk

                                         You've never explained how selecting one check box is supposed to select some but not all schedule records. You've simply said that they were "related". If you have 50 related schedule records and you want to select 5 with a single mouse click. How do you identify the specific 5 records to select?

                                    1 2 Previous Next