Where to place Script so it will run just prior to the Portal loading
I use FileMaker 13 Pro and have a layout that has 5 tabs on it. On the main part of the layout I select a stock symbol (AAPL) and each of the 5 tabs displays information about the particular stock I select. One page has a portal that lists all activity that relates to AAPL, like the dates it was purchased (say there were several purchases). I would like to have the cursor in the portal end up on the most current record versus the oldest record as it does now. I have done a portal sort both ascending and descending by date, however it always ends up on the oldest record.
Question: I can write a script so it goes to the most current record if I clicked a button, however, I would like to trigger this script so it ends up on the desired record when I first view the portal. Where can I place this script so it automatically runs when the AAPL stock symbol is selected on the main part of the layout?