3 Replies Latest reply on Mar 29, 2011 9:33 AM by philmodjunk

    Using a filtered selection portal to populate a field

    johngrote

      Title

      Using a filtered selection portal to populate a field

      Post

      I have a fairly complicated database that i use to figure veterinary fees. I am having trouble getting a filtered selection portal to populate a field. Once I get this working, I would like to use it in a number of layouts. I get the relationship to work as far as the portal is concerned and the filtering also to work, but I can't get the selection to populate the field. To explain a little further, my fee solution uses specific tests from two different laboratories. I have a laboratory table with serial numbers assigned to each lab and the specific tests for each of those labs listed under the respective companies (several hundred tests, hence the filter). For my laboratory fee solution, I want to be able to populate the new specific test field and its related cost (another field) from the pop up window containing the portal. I have made the test name field in the selection portal a button and attached a script which I thought would commit the name to the field in the lab fee solution and the cost field and I could then finish completing the information on that test to figure the fee. I have tried using different parameters (I understand them poorly) and no matter what I do, I can't populate the LaboratoryTestName field from the selection portal pop up window. Any suggestions would be appreciated. I am currently using vs. 10 pro advanced.

        • 1. Re: Using a filtered selection portal to populate a field
          philmodjunk

          Use your button to run a script like this:

          Set Variable [$Lab ; PortalTable::LabField]
          Close Window  //close the pop up window
          Set field [LayoutTable::LabField ; $Lab]

          I suspect that LabField should be your serial ID field for identifying the Lab by ID number. If you have the right relationship set up, you can place the lab name field from the related field on your layout and the script's set field step will cause it display the correct name after you click the button in the portal row of your pop up window.

          • 2. Re: Using a filtered selection portal to populate a field
            johngrote

            Dear Phil,

            I tried the solution you suggested, but I still can't get it to work. My problem really is understanding variables and script parameters and their use. I have several books on Filemaker and have read all the information about them and still don't understand. The frustrating part is that everything else works well, but I just can't get the field to populate with the test name and cost. Yikes!

            • 3. Re: Using a filtered selection portal to populate a field
              philmodjunk

              The sample I posted does work. I use it all the time. Please note the assumptions I made and listed at the bottom of my last post as they are key to getting this to work.

              Feel free to describe your scripts and set up in more detail and how the suggested script failed and then we can take another crack at figuring out something that will work.