AnsweredAssumed Answered

Portal with one container for multi images

Question asked by LanR on Dec 1, 2010
Latest reply on Jul 28, 2015 by RobertMoss

Title

Portal with one container for multi images

Post

Problem Solved: file with an image container to show images one at a time where there are a varying number of images per record.

I just switched from FileMaker 6 to FM Pro 11 and one solution didn't quite update properly. This one has a table (related daughter file in FM6) that is images only to be able to display varying number of images in each record of the parent file. Each record in the daughter file has a number field that relates to the parent file, a container for an image and a serial number field unique for each record, also related to the parent file. The images are shown on the matching record (linked through the number) in the parent file on a portal. There is a field on the parent that shows the total number of images for the record and one that shows which image is currently being shown (i.e. 2 of 5, or 1 of 7). There are two buttons to move to Next or Previous image. A script for each button uses Set Field (Current Row), Current Row + or - 1, and Go To Portal Row... . to move up and down in the images. The Relations are in the main file linking the number to the number field of the image table of the daughter file and the second one linking the serial number to the serial number in the daughter file.

This works perfectly, and was done from suggestions from this forum many years ago when FM6 was current. Oddly, this only works if the image container field in the parent file sits on the main window, not on the portal (which I shrunk down to an inconspicuous dot).

After converting this solution to FM 11, the buttons would not work to navigate to Next or Previous image, or show an image. By tweaking a couple things, I got the first image to show, but couldn't change to the next one. The scripts were correct and the relations were correct. As many of you know the process, what followed were many hours over a few days trying to find the problem. There were scarce few messages in forums addressing showing multiple images in one field, and none offered a solution.

Finally, yesterday I found the solution in this forum in a message that did this with a different method, the portal must have a vertical scroll bar. In the conversion of the file from 6 to 11, this was not created and I continued to overlook that point. Also, the relationship of the serial number field had to be changed, from linking directly from the parent table to the one table in the daughter file to making that link to a copy of the table.

The latter point I discovered by accident/trial and error. Reading messages and the Users Guide, there was mention of needing to use a self join for similar situations involving inventory to sales, etc. I tried a self join and was awarded with a copy of the table in the daughter file. Still couldn't make it work. Finally, by deleting the self join, but linking the parent serial number field to the serial number field in the copy of the table in the daughter file, it works, and unlike in the FM6 file, the image field can be properly placed on the portal window.

I just thought some of you might be interested and if anyone needs another solution to show a selected image on a parent file from a varying amount of images in a daughter file (or I assume table in the parent (and only) file, which is a new concept to me having only worked with FM6 with separate files) then let me know and I will post the button scripts and all information.

Now I have to be brave and move the daughter file records to a table in the parent file to be modern and up to date.

LanR

Outcomes