3 Replies Latest reply on May 29, 2017 8:57 AM by MichaelManousos

    Showing photos from Container fields in portal

    sherab4

      I had an old Job Photos layout that works when I click on a thumbnail and the photos appears in the Selected File Container. The Button setup for the thumbnail is as shown in screen shots. I did keep the same setup for the new Job Photos layout with a portal, just changed the name of the Container etc.

       

      I added the field Selected Photo so I could see the text that is added and it appears to be wrong, I don't see how this will bring in the selected photo from the portal. Also the field Selected Photo Placeholder doesn't update because keeps the container name. Wondering what this should show to bring in the selected photo and how this should be done. with the old Jobs Photo layout I can see why this works because the photos are in a different container and with different names. But the new Jobs Photo layout with the portal doesn't have different names.

       

      Sorry if I am babbling on here but trying to explain what I am thinking and what appears to be happening with the new layout. Screen captures are attached.

        • 1. Re: Showing photos from Container fields in portal
          sherab4

          Should have mentioned that If I have more than one photo in the portal, I can only ever see the first photo in the portal. If I click on any other thumbnail, nothing happens. So if I add a photo to another job, I can click on the thumbnail and the photo appears in the Selected Photo Container, but add other photos and the same happens.

          • 2. Re: Showing photos from Container fields in portal
            erolst

            sherab4 wrote:

            I don't see how this will bring in the selected photo from the portal. Also the field Selected Photo Placeholder doesn't update because keeps the container name. Wondering what this should show to bring in the selected photo and how this should be done. with the old Jobs Photo layout I can see why this works because the photos are in a different container and with different names. But the new Jobs Photo layout with the portal doesn't have different names.

            IIUC, until now you were copying data. There is a way where you only copy over the primary key of the desired related record to get a "pointer" to that record.

             

            This usually works by creating a field that is set to the primary key of the "selected" (well, at that moment it's just "clicked on") portal record and drives another relationship to the portal table, where

             

            LayoutTable::id_selected = PortalTable_selected::id

             

            You can also use the existing relationship. Duplicate your portal, make it just one row tall and give it an object name.

             

            Define a portal filter like

             

            $$selectedPhotoID = Photos::id

             

            Selecting a photo then uses a script like

             

            Set Variable [ $$selectedPhotoID ; If ( Photos::id = $$selectedPhotoID ; "" ; Photos::id ) ]

            Refresh Portal [ "portalName" ]

             

            The advantage in all this is not only avoiding to copy data, but to have access to the entire record, not just a single field.

            • 3. Re: Showing photos from Container fields in portal
              MichaelManousos

              Off topic

              when you click command shift 4 to capture your screen you can click space so you just capture your current windo e.g. filemaker