6 Replies Latest reply on Jun 23, 2015 12:59 AM by KylerPhilips

    Permanently filter list view

    KylerPhilips

      Title

      Permanently filter list view

      Post

      Hi guys, 

      Can I permanently filter a list view that I have, it contains request records and I only ever want to show records that have no Agency id tied to them? Almost a permanent find request maybe? I'm not sure how it would work...

      Thanks

       

       

        • 1. Re: Permanently filter list view
          philmodjunk

          You can use script triggers, scripts and custom menus to achieve that result.

          OnLayoutEnter can perform a script that finds only records with no Agency ID.

          OnModeExit can constrain the found set to the same criteria any time the layout exits Browse Find mode and this will automatically filter any user initiated finds.

          The Perform FInd menu option can be replaced with a script that performs the find and then constrains to those with no ID.

          Show All Records and Show Omitted Only can be removed from a custom menu or replaced with scripts that Show All Records with no ID and show omitted records only with no ID.

          • 2. Re: Permanently filter list view
            KylerPhilips

            Thanks, can I make this more dynamic, in my current example I have a list view with the different requests that have to be accepted by different agencies (see attached image). The accept button should then tie the request to that agency by placing the related _fkAgencyId in the Requests table - this I will need to work out, how I can pull the relevant Agency information from the user that is logged in? Can i associate a UUID (user account) with a staff member which is then linked to the other Agencies table (relationship discussed in previous thread). Then, I will Perform a 'Send Mail' script step via SMTP that's pretty basic, but can I then get the request to disappear from the list view once it's been accepted?

            • 3. Re: Permanently filter list view
              philmodjunk

              A reference to another thread doesn't help me understand your question. There are just too many to which I have posted comments to keep them straight without an actual link to bring up the thread and look at it.

              but can I then get the request to disappear from the list view once it's been accepted?

              A script can use Omit Records to drop records from the current found set.

              • 4. Re: Permanently filter list view
                KylerPhilips

                I've only been able to get this working by Performing a Find script with criteria "Omit Records" that match * (have data) and then left are only empty values of the id. Using == in a the ID field didn't work for some reason with a find record request. Also, on initial enter of layout, when I perform a find request if there are no records I get the message (attached picture) - how can I prevent this and just show a custom dialog when there are no records that match the find request. 

                 

                 

                • 5. Re: Permanently filter list view
                  philmodjunk

                  I've only been able to get this working by Performing a Find script with criteria "Omit Records" that match * (have data) and then left are only empty values of the id. Using == in a the ID field didn't work for some reason with a find record request.

                  Compare what you are doing to the scripted find examples found here: Scripted Find Examples

                  If that doesn't enable you to get the find to work, please provide a detailed description of exactly how you are trying to perform this find.

                  To keep the "no records match..." dialog from interrupting your script use Set Error capture[on] to supress the dialog. If you want you can then use an if block that checks to see if Get ( FoundCount ) is zero in order to display your own custom dialog. Examples of this can also be found in the above thread.

                  • 6. Re: Permanently filter list view
                    KylerPhilips

                    Thanks, if two agencies are logged on and try clicking on the same request and accept at once, I assume the last of the two clicks will overwrite the other - what's the best way to manage this? Can I set all the fields to non-editable once in the script?