4 Replies Latest reply on Jan 1, 2013 1:32 PM by Nighthawk

    Filtering a portal based on global input...

    Nighthawk

      hi everybody...

      hope you guys all had a good christmas.

       

      so - here is my scenario - a friend of mine runs a kind of pearl? business... those small little things that you create jewellery with. she stores a lot of stuff and wanted a db to track all stock - outgoing stuff and the stuff needed to create individual pieces. so far so good...

       

      i have five tables [ customer - product - article - storage - supplier ] the article table is where all stock products are stored. all working fine, however instead of searching for available articles... i would like to filter the article table... for this i have created a TO of the article table and hooked it up to itself via pk_articleID and fk_articleID... i created 4 global fields ( each one for a filter criteria within the article table ), connected the global g_article_type to the article_type within the relationship - so eventually have 2 criteria.

       

      hope this is not too confusing...

       

      then i created a new layout - inserted a portal based on the above keys via a relationship article_ARTICLE_filtered... the four global fields are on the layout which is called article_filter within the body and they are formatted as a pop-up menu, so she can select criteria out of a list rather then entering values by hand. i chose to show 20 rows which is sufficient for the requirement. on enterring the layout article_filter the portal shows no records - which for me makes sense... since no filtering ie match field has been chosen ( no criteria has been entered ), however on entering a criteria ( and here i might add - i have only 1 field activated for testing ) via the pop-up article_type nothing happens... which i did not expect... and i am probably missing the obvious... i guess...

       

      one other thing is how to activate or filter down based on entry of the other global values...

       

      anybody got any ideas as to where i am missing something or can shed some light... hope my description is not too wild... in case of any question... just drop me a line... thank you

      as always any help is much appreciated.

       

      all the best from germany

       

      jurgen

        • 1. Re: Filtering a portal based on global input...
          taylorsharpe

          The global field may need committed.  You may need to have a script trigger that each time  you modify the global field by typing a new character, it commits and then goes to the end of the field to type the next character.  Just remember the filter won't happen until the global field commitment happens. 

          • 2. Re: Filtering a portal based on global input...
            Nighthawk

            Hi Taylor,

             

            thanks for the thought... tried that already and there is no change whatsoever... I just wonder if my way of thinking is somewhat twisted. The approach is correct I thought... got any other ideas ? In addition I noticed that - when filtering - it actually filters the articles - it is just not displaying them in the portal...

             

            Message was edited by: Nighthawk

            • 3. Re: Filtering a portal based on global input...
              nickchapin

              It sounds like you have a confused relationship. Let me see if I'm understanding your need.

               

              On your Articles TO layout you want a self-join portal to show just specific records. Correct?

               

              Here's the old-school way: Let's say that your records have the "size" field and you want to show either small beads, medium beads, and large beads. That size field will be indexed. You then have ONE global field using ONE value list of small, medium, and large. That global field is in a relationship to the size field: article::global > article::size. When you select (and commit) the global field the portal should behave as you're expecting.

               

              If you need further filtering then you can add more globals and use those in the same one self-join.

              • 4. Re: Filtering a portal based on global input...
                Nighthawk

                Hi Nick,

                 

                thank you for your reply, I fixed it in the meantime! However I have the setup as you described it here. Still strange is that it didn't work as per setup and description... sometimes I am just puzzled... As I see it - I don't spend enough time developing... otherwise I wouldn't have those problems. grin

                So thank you - it is good to know that there is help at the end of the keyboard.