Newbies FMNewbie31 Posted November 14, 2012 Newbies Posted November 14, 2012 Hi,  So I got a script that shows a custom dialog to change the layout and remove the subsummary so that the DATA shown on LIST view would be sorted by the column header. My question is in that how can I add to the script so that the custom dialog would only appear under one circumstance: and that is, when the subsummary is shown (ie: when the database is sorted by the subsummary, the dialog shows; but when it isn't it just automatically sorts the list descending/ascending.  In addition, I'm trying to use a global variable to capture the state of the subsummary report... suggestion on how to do this?  I've attached a picture of my script to this post for further analysis.  Input greatly appreciated.Â
Fitch Posted November 14, 2012 Posted November 14, 2012 Get(SortState) will tell you if your records are sorted or not, but it won't give you the details. There's no way to get that information after the fact. Which is pretty dumb, since FileMaker obviously does know what sort was just done -- you can see it if you hit ctrl-S again after you sort. So, you'll need to script your sorts, and in the sort script, set a global variable -- e.g., $$this -- to the name of your sort field. You can then refer to that variable in other scripts and branch them accordingly. 1
Newbies FMNewbie31 Posted November 15, 2012 Author Newbies Posted November 15, 2012 Hi Fitch,  So I set the global variable as $$IsSubSummary to indicate when the list is sorted under subsummary... and I tried to make it so that the dialog would appear only when it's sorted by subsummary. However, it's now currently skipping the dialog step within the script altogether. Do you have any suggestions as to why this is occurring?  I realized that the $$IsSubsummary goes from 1 to 0 using data viewer (in my second screenshot) after I hit the first If function.
Fitch Posted November 16, 2012 Posted November 16, 2012 You're testing for $fieldname = TypeName_s ... and then you're testing for $fieldname = TypeName // with no "_s" They can't both be true.
Recommended Posts
This topic is 4390 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now