6 Replies Latest reply on Jul 6, 2011 6:44 PM by DavidRuggles

    Previous and Next Image Buttons

    DavidRuggles

      Title

      Previous and Next Image Buttons

      Post

      I have a photos table related to my primary table, I'm trying to display images from the photos table one at a time on my layout with previous and next buttons to rotate through all available photos for the current primary table record. I found and tried to implement the steps in this post: Portal with one container for multi images

      Here's what I've got so far:

      on my layout I have a Portal:
      Show related records from: Photos
      Filter portal records $$PhotoID = Photos:id
      Initial row: 1 Number of rows: 1

      In Layouts | Layout Setup | Script Triggers:
      OnRecordLoad -> Initialize Photo ID

      Initialize Photo ID script:
      If [not IsEmpty(Photos::id)]
        Freeze Window
        Go to Related Record [Show only related records; From table: "Photos"; Using layout: "Photos" (Photos)]
        Go to Record/Request/Page [First]
        Set Variable [$$PhotoID; Value:"Photos::id"]
        Go to Layout [original layout]
        Refresh Window [Flush cached join results]
      End If

      When I open/display the layout after a few seconds an hourglass cursor appears with esc next to the hourglass, when I press esc it jumps to the Photos layout. Any suggestions on what I'm doing wrong?

      Thanks!