4 Replies Latest reply on Feb 7, 2010 1:26 PM by StilLearning

    Global Field in a find

    dpbklyn

      Title

      Global Field in a find

      Post

      Hello and thank you in advance!

       

      I am using FMPro 9.0 on OS X, 

       

      I am trying to use a "form" to perform a search in a script. I have an unrelated table set up that I am using to create a layout and the values from that layout are copied into global fields.

      I would like to use the values in these global fields in a "perform find" where (for example):

      MembersTable::member_number>ComparisonTable::GlobalField

      This find would change every time we filled out the form, but that is the point. 

      I am using the Script Manager, but i don't know the syntax to bring the values from the global field into the find.

      Again, thank you for your help.

      dp 






        • 1. Re: Global Field in a find
          LaRetta_1
            

          Enter Find Mode [ uncheck pause ]

          Set Field [ MembersTable::member_number ; ">" & ComparisonTable::GlobalField ]

          ... set any other fields with their globals as well

          Set Error Capture [ On ] 

          Perform Find [ ]

           

          You cannot use globals within stored Find Requests. :smileyhappy:

          • 2. Re: Global Field in a find
            dpbklyn
              

            THANK YOU!!!

             

            This was EXACTLY what I was looking for! 

            • 3. Re: Global Field in a find
              StilLearning
                

              Okay, I understand the principle of not being able to use Global Fields within the “Find Request” script function (which sadly I’ve just wasted 2 hours attempting), but have not been able to get a modified 2-part script structure to work.

               

              Fields Created:

              Delegates::Payment_Date (Date Field specific to individual Delegate)

              Delegates::Payment_StartDate_FIND (Global Date Field created specifically as a search parameter)

              Delegates::Payment_EndDate_FIND (Global Date Field created specifically as a search parameter)

               

              Objective:

              Create script to identify delegates who made payment after Payment_StartDate_FIND and before Payment_EndDate_FIND

               

              Specific Request(s) as this is my first time trying to write a find Field=Global Field script:

              How do I structure the “Set Field” function parameters? 

              Is there anything that goes into the “Perform Find” function?

               

               

              Thanks so much as this is killing me....StilLearning.

              • 4. Re: Global Field in a find
                StilLearning
                  

                It never fails....I write a question and within 20-minutes I figure it out: Script and Reports all created and tested.

                 

                Sorry for the distraction....

                 

                Of note, for those who ever have similar problems, I was trying to experiment with the find parameters within the script which is a huge waste of time.  It's much more efficient to verify your find parameters by simply going to your primary layout, select the "Find Mode" and manually enter your parameters until you get the output you're looking for....

                 

                I have no idea what that wasn't self-evident to me when I started, but it wasn't to save others the same error, I thought I just type it out.

                 

                Additionally, to find date ranges between two global date fields you use "..." between the (2) field names and you're all set.

                 

                 

                Cheers all.....