Jump to content

Get(WindowMode) has undocumented Layout mode value


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

Recommended Posts

FM8 Help describes four return values from the Get(WindowMode) function: 0 (Browse), 1 (Find), 2 (Preview) and 3 (printing).

The Description goes on to say "If a script using this function runs while the file is in Layout mode, FileMaker Pro switches to Browse mode and returns 0."

I found this while searching for a way to disable an auto-entry calculation in Layout mode. On a whim, I opened the Data Viewer tool in Layout mode and discovered that Get(WindowMode) returns a 4 -- just what I need!

Link to comment
Share on other sites

That's interesting how you got the "4" when you used the function in the Data Viewer while in Layout mode.

What do you mean by "disable an auto-entry calculation in Layout mode"?

Link to comment
Share on other sites

What do you mean by "disable an auto-entry calculation in Layout mode"?

I have an invisible layout field that detects a record change using an auto-entry calculation. Tonight I enhanced this calculation using the EventScript plug-in to automatically change the current layout based on another field.

I got that working fine in Browse mode. But when I returned to Layout mode to make some adjustments, the "onRecordChange" auto-entry calculation got triggered when I changed from one layout to the next. EventScript then triggered my layout syncing script, which changed back to Browse mode.

I'm now using Get(WindowMode) to disable layout switching in Layout mode.

The EventScript plug-in is available from Softwares for Humans.

Link to comment
Share on other sites

But when I returned to Layout mode to make some adjustments, the "onRecordChange" auto-entry calculation got triggered when I changed from one layout to the next. EventScript then triggered my layout syncing script, which changed back to Browse mode.

I didn't realize EventScript would do that in Layout Mode. That's interesting to know...Thanks!

Link to comment
Share on other sites

This topic is 5703 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
 Share

×
×
  • Create New...

Important Information

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