4 Replies Latest reply on Feb 16, 2010 5:22 PM by nolak37

    view container filed files in large

    nolak37

      Title

      view container filed files in large

      Post

      Hi,

       

      I have 2 tables PT (patients) and PT_Files relater through PT_ID.

       

      on PT_Files i have 4 fields

      File  (container Field)

      Name (text)

      Date (date)

      PT_ID (number)

       

      On a layout Showing records from PT I added a portal displaying records from PT_Files and then created a new layout for PT_Files where the container field is large allowing you to see the picture inserted.

       

      On the PT layout i created the File field into a button and have it go to related record in new window.

       

      everything works fine the way i wanted except I figures it would be easier considering i have the space to view the large file on the same layout but i cannot figure out how to do this.

       

      I added the File field next to the container and made it large, then anchored it in all directions so the user could stretch it out but the field shows only the first file and wont change when i click on the other related fields from the portal

       

      Can someone please help? Im not sure if what i want is possible but it would be nice to know for sure

       

      Thanks

        • 1. Re: view container filed files in large
          philmodjunk
            

          You need a script, a new field and a relationship.

           

          In PT, define a number field, SelPTFile

           

          Link this new field to a new table occurrence of PT_FIles on your relationship graph

          Select PT_Files and click the button with two green plus signs to make a copy of it. Rename it "SelectedPT_File"

          add a relationship:

          PT::SelPTFile = PT_Files:: PT_ID

          PT::SelPTFile = SelectedPT_File:: PT_ID

          Place SelPTFile::File on your layout next to your portal.

           

          Write a script:

          Set Field [PT::SelPTFile ; PT_Files:: PT_ID]

          Refresh Window (Add only if the layout doesn't automatically show the selected file.)

           

          Put a button in the row of your portal to run the above script. When you click that button, the row's File should appear in the larger field.

          • 2. Re: view container filed files in large
            nolak37
              

            Thanks for your reply,

            I followed the instructions as you posted andgot nothing, its only displaying the first record created. I did try adding refresh window to the script as well.

             


            PhilModJunk wrote:

            add a relationship:

            PT::SelPTFile = PT_Files:: PT_ID

            Place SelPTFile::File on your layout next to your portal.

             

            Message Edited by PhilModJunk on 02-16-2010 03:24 PM

            on the relationship PT::SelPTFile = PT_Files::PT_ID   did you mean PT::SelPTFile = SelectedPT_File::PT_ID am I supposed to make the relationship to the new TO?

             

            I tried both and neither worked


            • 3. Re: view container filed files in large
              philmodjunk
                

              Good catch and my mistake.

               

              PT::SelPTFile = SelectedPT_File:: PT_ID

               

              is what I should have posted.

              • 4. Re: view container filed files in large
                nolak37
                  

                Got it, turns out i had the relationship set up wrong.

                 

                Thanks for your help