Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4390 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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. 

post-107701-0-61987000-1352915934_thumb.

Posted

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.

  • Like 1
  • Newbies
Posted

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.

post-107701-0-54523300-1353007233_thumb.

post-107701-0-04046800-1353007240_thumb.

Posted

You're testing for

$fieldname = TypeName_s

... and then you're testing for

$fieldname = TypeName // with no "_s"

They can't both be true.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.