5 Replies Latest reply on May 16, 2012 7:58 AM by Jason Wood

    Open PDF linked to value in portal row.



      Open PDF linked to value in portal row.


      Hello FM experts.


      I would like to create a portal with a text field based on a value list (say: product A, product B, ...), with different set of values for each record. In this portal row, I want to include a button that opens a specific PDF file: button in row containing product A opens PDF file about product A, and so on.


      Is this possible?


      Thanks in advance


      Cezar Mesas 

        • 1. Re: Open PDF linked to value in portal row.
          Jason Wood

          Sounds like the portal row is related to a products table. If you're using version 12, why not put the PDF in a container field in the products table?

          Setup a layout with the container on it (large).

          Then in the portal, the button would "Go to related records, products, using layout: container view.

          If you're not using a container, or if you're not using FileMaker 12, I don't think you'll be able to get a PDF on the screen by clicking a button unless you use applescript (or windows equivalent?)

          • 2. Re: Open PDF linked to value in portal row.

            Thank you for the answer.

            The problem is that for each text field that I randomly choose (drop down list, from a value list), a unique PDF file should come up. How can I relate every single item of the value list to a specific PDF file, and how to bring it up using a button?

            • 3. Re: Open PDF linked to value in portal row.
              Jason Wood

              I assumed the drop down list caused the line item to relate to a products database, where the pdf would be stored. Please explain in more detail what you're trying to do.

              What are your records? What is the portal showing? Where is the value list getting its content from?

              • 4. Re: Open PDF linked to value in portal row.

                It should be actually a list of drugs (such as antibiotics or anti-hypertensive drugs), for a given patient (records) with other items in the same row, like number of pills, how many times a day it should be taken, and so on. I am a physician, and this would be particularly usefull to print out prescriptions and store patients current prescription.

                But I would like to have a reference document for those drugs I choose to prescribe, such as a PDF document. The drugs list can be put in a value list, so do all oher items in the row, but how bring up the specific reference paper?

                Thank you for your interest

                • 5. Re: Open PDF linked to value in portal row.
                  Jason Wood

                  Sounds like you're manually coding the value list. It should be driven by a relationship to a "Drugs" table. The drugs table could be as simple as having the drug id (key field/serial number), drug name, and container field for the PDF.

                  If you do not already have it, you probably should have a table for patients, a table for prescriptions, and since a prescription could have more than one drug, you'd also have a line items table to list individual drugs on the prescription.

                  So your relationship graph would be connected something like this:

                  Patients - Prescriptions - Line Items - Drugs

                  Where patients is related to prescriptions based on patient id, prescriptions is related to line items based on prescription id, and line items are related to drugs based on drug id.

                  If there are not too many drugs, you could have a popup menu in the line items portal (on prescriptions screen) to allow selection of the drug (and if "allow creation of related records via this relationship" is checked, making this selection would create a new line item). The value list will be based on the drug id, then choose the option to show the additional field - drug name, and choose the option to hide the first field (you don't need to see the drug id - that's behind the scenes for the relationship).

                  Then, like I said earlier, to view the PDF, have a button on the portal line to "view pdf", which will go to the related record in Drugs, and dislay a layout with a large container on it that contains the pdf. You need version 12 to display a PDF in a container.