3 Replies Latest reply on Mar 16, 2010 11:50 AM by philmodjunk

    Working between layouts

    drushton

      Title

      Working between layouts

      Post

      I would like to find records that are all in the same table by a field when changing layouts by using a button. Button= go to layout but finds the records from the field so they can be viewed when the layout opens.

       

      I would also like to make a way to be sure all the fields (fields use pop up menus) are completed before the user can exit the layout. A error message would be nice to tell the user what must be completed before they would be allowed to move to another layout.

        • 1. Re: Working between layouts
          philmodjunk

          "I would like to find records that are all in the same table by a field when changing layouts by using a button. Button= go to layout but finds the records from the field so they can be viewed when the layout opens."

          So if a user has selected "Apple", you want to find all records with "Apple" in a specific field and display the results on a differnt layout?

           

          Set Variable [$Criteria ; Value: YourTable::YourField ]

          Go To Layout [YourLayout]

          Enter Find Mode[]

          Set field [ YourLayoutsTable::YourField ; $Criteria ]

          Perform Find []

           

          "I would also like to make a way to be sure all the fields (fields use pop up menus) are completed before the user can exit the layout. A error message would be nice to tell the user what must be completed before they would be allowed to move to another layout."

          In field options, you can set a validation that makes these fields required fields--that's the most secure approach. A less secure approach would be to include additional lines at the beginning of the above script that use IsEmpty(Yourtable::yourField) to check each field and halt the script with a warning message if the user has not selected a value.

          • 2. Re: Working between layouts
            drushton

            That worked good  except when I go into the layout the script ask if I want to cancel or continue. When I continue it finds the records. What have I done wrong? Also the validate the field is not empty worked well. In this layout the field I searched with to go to the layout now I want to change that field back from yes to blank  (with the popup menu) and verify that field is empty when leaving the layout.How to I verify it is empty? This will let me use the field to let another use it on their request Thank you so much for your help .

            • 3. Re: Working between layouts
              philmodjunk

              Does your script have

               

              Enter Find Mode[]

              or

              Enter Find Mode [pause] ?

               

              Sounds like the latter and there's a check box to clear to remove the pause parameter.

               

              You can write validation rules as calculations so you can use IsEmpty( YourField ) in a calculation to make sure that the field is left empty. I nicer way might be to simply write a script that clears this field whenever you leave the layout.

               

              In filemaker 11, you can use the OnLayoutLeave event to trigger a script: Set Field [ YourTable::YourField ; "" ] to clear the field. In older versions, you may still be able to do this by including this step in any scripts that take the user to a different layout and in a script that runs when a user closes the file.