4 Replies Latest reply on Dec 1, 2009 11:17 AM by synergy46

    Find exit producing weird results....

    synergy46

      Title

      Find exit producing weird results....

      Post

      I have 2 tables:

       

      Patients:: Patienid.pk

       

      Supplements:: Patientid.fk

       

      I have a script that reads:

       

      ENTER FIND MODE

      Note: at this point debug indicates that both PatientID values are 1 and valid.

      Set Field [supplements:: patientID.fk; Patients:: patientid.pk

      Note: at this point debug indicates that both PatientID values are empty???

      PERFORM FIND

       

      I just can't see it.  When I exit Enter Find Mode, both values go blank.  Whats going on?

        • 1. Re: Find exit producing weird results....
          StellaLuna
            

          When in Find Mode, records don't have any values so your Patients::patientid.pk is empty so there is no value to grab to place into supplements:: patientID.fk.  You must either use variable, global or script parameter to grab the value before entering find as:

           

          Set Variable [ $patientID ;  Patients::patientid.pk ]

          Enter Find Mode []

          Set Field [  supplements:: patientID.fk ; $patientID ]

          Set Error Capture [ On ]

          Perform Find [] 

          etc

           

          Or you can set a global before entering find mode or you can attach a script parameter to grab that info right to your button first.

          • 2. Re: Find exit producing weird results....
            synergy46
              

            Thank you for the explanation. 

             

            After posting the 'problem', your solution occured to me.  But, I was still lacking a lucid explanation.

             

            Thanks again.

             

             

            • 3. Re: Find exit producing weird results....
              TSGal

              synergy46:

               

              Thank you for your posts.

               

              Just prior to entering Find mode, the current record in Browse mode lists Patientid.pk with the value of 1.  However, since you are now in Find mode, it cannot access the information in Browse mode.  That is why you store the contents to a variable prior to entering Find mode.  Therefore:

               

              Set Variable [ $variable ; Patients:: Patientid.pk ]

              Enter Find Mode []

               

              Now that you are in Find mode, you can set the field to the variable and perform the find:

               

              Set Field [ Supplements:: Patientid.fk ; $variable ]

              Perform Find []

               

              Does this make sense?

               

              TSGal

              FileMaker, Inc. 

               

              • 4. Re: Find exit producing weird results....
                synergy46
                   Perfect.  Thanks for the response.