AnsweredAssumed Answered

Sort Script Works from Button, but not from Trigger

Question asked by wadef on Jun 25, 2011
Latest reply on Jun 27, 2011 by wadef


Sort Script Works from Button, but not from Trigger


I'm running FMP 11.0v3 on a Mac mini, OSX 10.6.7.  I have prior experience as an assembly language & Fortran programmer and have been working on this one database (my first) for over a year.  So I guess I'm slightly more than a novice.  I'm generating an investment management database to replace my useless Quicken package.  Most of it is working with no problem.

However, I have 3 layouts, all based on the same table and each including a sub-total field for each grouping and a % field .  I have 3 buttons on each layout which call one of 3 scripts to go to one of the other layouts and sort it according to the view I want for that layout.  (e.g. by accounts for one, by security for another, by asset allocation type for the 3rd). This works well and the sub-total and % fields are correctly displayed each time a button to switch to a different layout is clicked.

As I would like to add 2 more layouts, each with it's own sort, I tried putting in a pull-down field with Account/Security/Asset Alloc plus 2 other values and I set up a trigger using OnObjectModify to call a script that checks the value and calls the exact same subscript as was associated with each button.

Much to my amazement, when FMP switches to a new layout from the pull-down script, the subtotals and % do not display.  If I put a pause/resume statement in my script as a debug tool, the totals and % DO display!!!!!!

I'm confused.  I've tried virtually every combination of parameters for the sort, but nothing seems to resolve this issue (other than putting in the pause).  As I really don't want to populate half my screen with buttons for selecting each layout, I'd really like to know what I've done wrong.

Thanks for any help or suggestions you can give me.