5 Replies Latest reply on Dec 2, 2013 2:28 PM by philmodjunk

    Using Globals for searches and avoiding record locking -- IWP

    carolyn

      Title

      Using Globals for searches and avoiding record locking -- IWP

      Post

           Hi All,

           I am using globals for a search screen because I want to capture the search criteria so I can display it when I return the search results.

           Everything is working except  a user cannot enter the global field when someone else is entering information in the same record.  I don't understand why globals are affected by locked records when they only apply to the current session? 

           What have I done wrong?  Please help.  This is what I did.

           Using FM Pro 11, IWP and client remote server.

           I added global fields to the main table that I want to searches on.

           I added the globals to a search layout.

           The user enters the values in edit mode (I have been unsuccessful in entering values in a global field in find mode.)

           The user submits the values via a button that has a script.

           The script collects the values and does finds and constrain finds based on the values submitted global fields matching the data in the corresponding data field.

           The problem is the user cannot enter values in a global if they are on a record that is being edited.  What have I done wrong or missed.

           Thanks in advance for any help.

           Carolyn

            

        • 1. Re: Using Globals for searches and avoiding record locking -- IWP
          philmodjunk

               Try defining the globals in their own table of globals instead of the main table. See if that helps avoid this issue.

          • 2. Re: Using Globals for searches and avoiding record locking -- IWP
            carolyn

                 Then do I need to point the layout to that table.  Because I had a problem attaching a field from a table that was not related.

                  

                 Thanks

            • 3. Re: Using Globals for searches and avoiding record locking -- IWP
              philmodjunk

                   If you are using the fields solely for the purpose of collecting criteria to be used in scripted finds, there shouldn't be any problem. A field with global storage specified, is accessible from any layout and script in your file.

              • 4. Re: Using Globals for searches and avoiding record locking -- IWP
                carolyn

                     Hi Phil,

                     I made a new table for the new globals.  However, the only way I avoided the lock was to enter the global fields on a none existing record.  I achieved this in 2 ways.

                     1) attaching the new globals table to the layout. Or any table that does not have records nor will have records.

                     or

                     2) before allowing the user to enter values in the global field, script does a search that I know will result in a 0 found set.  (while this is working, I'm not sure that this is a good way to do it.)

                     When I used the approach 1), my script had to switch to a layout attached to the table that had the records in which I was searching. Then swiitch back again.

                     I am doing a couple of other things with global fields which seem to be working.  Also when I enter the global field. it doesn't seem to matter to what table the field resides as long as the layout is pointing to a non record or not record holding table.

                     Any thoughts?  Thanks so much for your help!!!!!!

                     Carolyn

                • 5. Re: Using Globals for searches and avoiding record locking -- IWP
                  philmodjunk

                       2) sounds like a very creative way to handle this issue. No obvious draw backs to this trick come to mind.

                       For 1), I routinely open a small floating window with the needed global fields. Clicking a "find" button on this layout then performs a script that closes the small "dialog" and performs the find after using the data in the global fields to set up the find requests.