Plex 2E

  • 1.  Filtering using SQL String on a Blockfetch

    Posted Oct 08, 2014 11:45 AM

    I am wondering how do I use a SQL String to use in conjunction with while doing searching/filtering in Plex?  What do I do and where do I put this inside of Plex?  I know that this is possible, I just don't know what edit points  I apply this to in the BlockFetch.  I have multiple phone number fields and they want to type one number in and be able to search against all of the phone # fields.  Any help would be great.  I have done this in Obase and just don't know how to do it in Patterns.



  • 2.  Re: Filtering using SQL String on a Blockfetch

    Posted Nov 06, 2014 11:08 AM

    Anybody have any suggestions for Justin?

     

    JUSTIN COOK wrote:

     

    I am wondering how do I use a SQL String to use in conjunction with while doing searching/filtering in Plex?  What do I do and where do I put this inside of Plex?  I know that this is possible, I just don't know what edit points  I apply this to in the BlockFetch.  I have multiple phone number fields and they want to type one number in and be able to search against all of the phone # fields.  Any help would be great.  I have done this in Obase and just don't know how to do it in Patterns.



  • 3.  Re: Filtering using SQL String on a Blockfetch
    Best Answer

    Posted Nov 07, 2014 09:52 AM

    This is quite simple and very powerful for doing dynamic filtering, letting the user decide what to filter on. Simple answer is that you need to override the Blockfetch with your own SQL Select statement that you build up by creating the where part of the clause based on which fields have values to filter.

     

    The fields returned b the SQL select statement must be the same as the view that the blockfetch is under.

     

    then in a blockfetch in the following edit points add the 2 lines of code

    Edit Point  Start set fetch position

         Set  FetchL<UsePosition> = <UsePosition.Override>

     

    Edit Point  Start set fetch position

          Exec SQL  Source code:<your source code object with SQL statement>

     

    This should then work. You can of course dynamically build the SQL statement and pass it in as a parameter to the source code object.