April 26, 200619 yr 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!
April 26, 200619 yr 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"?
April 26, 200619 yr Author 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.
April 26, 200619 yr 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!
Create an account or sign in to comment