11 Replies Latest reply on Sep 24, 2012 11:26 AM by beverly

    Constrain Foundset and return to Original Record

    Padster

      Hi All,

       

      I'm having a little bit of difficulty with something and hoping that somebody might be able to point me in the right direction, or at least tell me where I'm going wrong. What I'm working with is Constraining a Found set, while navigating through said FoundSet.

       

      The basis for the Constrain of the Foundset is call lists, and the records moving from an Available to Active state. Active meaning that somebody has opened and is working on a record, therefore taking it out of the pool. Multiple people can have cross records in their foundsets.

       

      Lets say that you start a foundset with 100 records, as you move through this list, each time you press the 'Next' button, the FoundSet is Constrained to remove Records that are Active for Sombody Else, yet leaving your own Active Records in the FoundSet.

       

      The problem that I am having is that when you do the move to the next record, and the Constrain is performed, you are returned back to Record 1, I need to find a way that is you are on record 11, and the Constrain is performed, you return back to record 11, before moving to record 12 in the newly constrained Foundset.

       

      As an additional problem, this has to also work based on that you don't have to start at record 1, you can enter the FoundSet at record 50, meaning that as the Constrain is performed, any of the records between 1-49 could disappear, meaning that before the Constrain you could be on Record 50, then after the Constrain you could actually be on Record 10, before then moving to the next record...

       

      I hope that this all make sense, I am more than happy to provide a basic working file of where I have got to thus far if it would be of any help.

       

      The reason for doing it this way, rather that through DB Security, becuase of other possible variables that could cause a record to be inaccessible by the end user cause. I opted for Script security rather than using the DB Security for this reason.

       

      Regards,

       

      Pad

        • 1. Re: Constrain Foundset and return to Original Record
          beverly

          Until I get to where I can get you some links, try a search for

           

          DWINDLING VALUE LISTS

           

          I believe these will help you get what you want.

           

          -- sent from my iPhone4 --

          Beverly Voth

          --

          • 2. Re: Constrain Foundset and return to Original Record
            Padster

            Hi Beverly,

             

            Thank you for this, I have been doing my searches based on 'Constraining Found Set'.

             

            It seems I was search the wrong terms, I will see what this brings back for me.

             

            Cheers,

             

            Pad

            • 3. Re: Constrain Foundset and return to Original Record
              beverly

              Pad, I found a couple of blogs on this:

               

              Part 1 - http://www.filemakerhacks.com/?p=5219

              Part 2 - http://www.filemakerhacks.com/?p=5280

               

              Beverly

              • 4. Re: Constrain Foundset and return to Original Record
                Padster

                Hi Beverly,

                 

                Thank you for the Links, I did find these after your suggestion. I might well use this later, but it is not exactly what I'm after for this situation

                 

                I have built a little test file, this will open on a list of 2000 records. lets assume that the User did a search for records in "London",  this is the list returned.

                 

                There is a button for "Show Only Available", This will remove all Active (Status = 1) from the list. This is also the same action that the Constrain is performing. I cannot always assume that this buttong is press before a user navigates to the records, so I have to script the process in.

                 

                Hopefully this will help to better explain what I'm trying to get to as an end goal.

                 

                Cheers,

                Pad

                • 5. Re: Constrain Foundset and return to Original Record
                  comment

                  The problem with your request is two-fold: first, record numbers are based on their position in the current found set, in the current sort order. However, Constrain Found Set creates a new found set. The other thing is that the current record may not exist at all in the new found set.

                   

                  What you could do is store the current record's ID (either your SerialID or the internal RecordID) in a variable, before constraining the found set. Then loop among the new found set until you find your place.

                   

                   

                  Caveat:

                  I did not really understand the purpose of the entire exercise. I suspect there may be a better way to achieve whatever this is supposed to achieve. In any case, be advised that "script security" is not.

                  • 6. Re: Constrain Foundset and return to Original Record
                    beverly

                    I'm with Michael, I'm not sure of your purpose. I downloaded your example and it was not what I thought you said you wanted. The "dwindling valuelist" is a way to set a field with the ID (not the number) of the selection. Then the remaining items don't include that one. You don't need to "constrain", if you just use a GTRR (go to related record) from the found set, the found set doesn't change until you add or omit records. If you're trying to "select" a record (remove from the found set) AND then navigate to it, you'll need to rethink.

                    Beverly

                    • 7. Re: Constrain Foundset and return to Original Record
                      Padster

                      Hi Michael,

                       

                      Thank you for your responce.

                       

                      In regards to the foundsets, I understand that the constrain was creating a new foundset, the problem was getting back to the record you were previously on. The current record will always be within the New FoundSet as the Constrain is actioned before the move/navigation/Go To etc.

                       

                      The grand process behind this part of my system, is for telesales people working through a call list. They will be looking at the 'Customers' home screen which contains all the required info to make their call, add notes etc. These actions would move the 'Customer' from Available to Active, thus removing it from some anybody elses search. So they need a list that is constantly being updated through the day, and newly 'Active' customers being removed.

                       

                      If you can suggest a better way to approach this, then I would be glad for any input.

                       

                      The reason for the change from Record Level Security to Script level, this came at the creation of new 'Customers' in another section of the system. A check is run by the User to see if the customer already exists, and if that customer is already Active by another User, then the searching User would not find that record, therefore, potentially creat a duplicate 'Customer', with only the slightest spelling, typo difference.  With the Script Level Security, this means is that at a high level, everybody can seach customers, but then once they attempt to access the customers, the ones that they should not be seeing are removed through scripts. Record Level Security presented speed issues, due to the variables that caused a record to be unaccessible. Purely for background information.

                       

                      Regards,

                       

                      Pad

                      • 8. Re: Constrain Foundset and return to Original Record
                        DavidJondreau

                        If a contact in a list may become inactive due to the actions of another user, why have a list of contacts at all?

                         

                        Just have one record the user is looking at, and upon "Next", do a find for the next available record ( whatever "next" means in your context, alphabetical, date of first contact, etc).

                        • 9. Re: Constrain Foundset and return to Original Record
                          Padster

                          Hi David,

                           

                          Thank you for your responce.

                           

                          I hope that I understand what you are explaining here; a contact is accessed and updated, the 'Next' is actioned, a new search is run, that shows the next available record.

                           

                          Just as a question, in this senario, how would you track the records that have been access, but not action take. There are some cases where an Contact is looked at, but then has no status change. This would mean that they stay in the 'Available' category, therefore returned as part of a search, and possibly at the top of the list again.

                           

                          Cheers,

                          Pad

                          • 10. Re: Constrain Foundset and return to Original Record
                            DavidJondreau

                            Well, there are a variety of ways to accomplish that. But it depends on what your needs really are. For example, if a user accesses a contact record, but makes no change, should another user be able to pull that record up immediately afterwards? If a user accesses a contact record but makes no changes, when should that record be available again? Later that same day? Next week? You're fine tuning a workflow, but it's not clear what that workflow really is.

                             

                            In short, you can keep a list of access records in a global variable and reference that variable when doing your find to eliminate those that the user has looked at in their current session.

                            • 11. Re: Constrain Foundset and return to Original Record
                              beverly

                              Exactly as David says, there are THREE states here that I can determine.

                               

                              0 ready to select

                              1 selected - in process - not available for others to select

                              2 selected and changed in some way so that it is no longer selectable

                               

                              Your list would only show 0's. Then if a user "releases" a record, but has not changed, it can be "0" again an available for the next user.

                               

                              Beverly