How does your 'next' button load the next set of images? Does it update a field that is referenced in the relationship?
Many thanks for your help.
Each image has a unique id. When the user clicks the 'next' button a script sets a global field in the Parent record with the image id of the image in Row 3 of Portal 6, i.e. the last image on the layout. This global field is used in the relationship. The relationship says show records when:
Product Type in the Parent record = the Product Type in the Child record
the global field in the Parent record <= to the image id in the Child record.
This then shows the next set of images.
In the Inspector on the data tab, under the Behaviour settings, there is a "Hide object when" calculation. Put in this calculation, substituting your child table and field name into it:
Count ( ChildTable::ChildName ) ≤ 18
I have used 'Hide' on other places on the database. However the calculation you suggest above it won't do the job I need here. If you can imagine, I have for example 28 images for a product, the first 'set' of images is 1 to 18, the user clicks 'next' and then sees the remaining 10 images, there are no further images to click to, it is at that point that I need to hide the button. However, the total number of images will still be 28 so the button will not hide using that calculation.
That's the reason I need a count of how many images the user has viewed so far so that I can do something like, If total images available minus images views < 18, then hide the button.
The only way I can think of doing this is to count the number of 'blank' portal rows may be on the 'final' page - if that figure is less than 18 it means no more images to view, hide the button.
Sorry to be so taxing. Much appreciate your help.
Can you not do a Count ( relatedTable::key )? That should give you the current number of records that are populated.
Thank you for this, sorry I missed in replying to Chris! My reply to him applies I think, unless I'm missing something?
I might be wrong, but if you have a relationship that's based on a global field, then the Count ( ) should apply the filter. So if you have a total of 28 images (for example) and you're on the first set, then Count ( ) should show 18. Click "Next", and the remaining 10 images show up - so Count ( ) then returns 10.
If you're concerned about not showing the Next button if there are exactly 18 records, you can create another relationship that doesn't have the filter and use that to compare the screen you're on times 18 with the total count.
Mike and Chris, you are absolutely right! My apologies. I was looking at the total record count using a relationship from the Product Type - of course it was always giving me the total number of records.
My apologies again and thank you for persisting in giving me the correct answer when I had my metaphorical fingers in my ears shouting 'No, no, no...'