• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1117
  • Last Modified:

FM - Back Button for Layouts/Windows

Boss wants a simple BACK or PREV button so he can return to the layout he was in.  My problem is that we have four files, so Go to Layout [original layout] may work in the same file, but not across dbs.  I've made the latter work by capture the window name before navigating and returning.  So two questions:
1. Go to Layout [original layout] is not working.  Not sure why because it has worked for me before.  Nothing happens when you click a button that calls a script with this as the sole script step.  
2. How would you know if it is a layout from the same file or not.  There is a Get (Filename), so would I just set the equal to a variable and then do an IF statement, IF ( Get (Filename) = $PrevFileName) ?  If this is true, then Go to Layout [original layout] should work, if not then I could have previously capature the window name and then do a Select Window ($PrevWindow).  Does this sound correct?  If so, I just need answer to #1.
0
rvfowler2
Asked:
rvfowler2
  • 4
  • 2
  • 2
3 Solutions
 
Will LovingPresidentCommented:
1. Go to Layout [ Original Layout ] is designed to work within a script. It will return you to the original layout you started the script on, that being the reference point from which it's working. Outside of a script, there is no "original" reference point.

Most likely, with multiple files, you'll need to have a logging system that tracks which file and layout the user was on and various developers have developed systems over the years which can do that, although most of them work within a single file and you also have the issue of returning to the previous state or found set of records. The more you try to track the more difficult this becomes. You can't easily use Global $$ variables because they are file specific.

I know you probably don't want to hear this but your best best long term is to consolidate all of your user interface into a single file. You can still reference separate files for data if have a need to do that, but you can still put the user interface elements into a single file which make constructing a PREV or BACK button much easier.
0
 
slinkygnCommented:
The way we'd done this before was to either designate one of the files in a multi-file solution the "main" or "system" file, or to create a separate file in the solution explicitly to serve that purpose; that file would hold a "Session" table of per-user globals that would be consistently used across the project to hold data like this.  (The same can be done in many cases, but not all, with global variables within that file.)  You'd need some scripts in that file that would accept parameters so the main file can set those global variables from its own context instead of that of the file you're in.

That being said, if you use that to store the current and previous file and layout you were on, that may work for you.
0
 
Will LovingPresidentCommented:
Seedcode had a product called BackMagic which was designed to do what you are looking for but has discontinued it because: "BackMagic is no longer available--written in FM8.5, it's more complicated than it needs to be and most folks can now write a "back" system in FM13 without our help. Docs follow for folks who already have this installed."

You can find instructions, documentation and downloads at: http://www.seedcode.com/pmwiki/index.php?n=BackMagic.BackMagic 

Also check out Ray Cologon's "Retrace Steps" at: http://www.nightwing.com.au/FileMaker/demos9/demo905.html

And finally this discussion which includes a sample hybrid technique of the above two: http://www.filemakertoday.com/com/showthread.php/29158-Looking-for-a-quot-BACK-quot-button-script
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rvfowler2Author Commented:
All helpful comments.  Going to try my solution slinkygn's way and see how it work.  And, yes, Will, eventually I want to go from 4 files to 1; already went from 14 down to 4, just a long process.  :)
0
 
Will LovingPresidentCommented:
As noted, you can always begin by moving the interface elements to your central file and leave the data where it is.
0
 
slinkygnCommented:
Will actually has a really good document on how to consolidate as quickly and painlessly as possible.  Sometimes folks underestimate how important the order in which you do parts of the process is; it can mean the difference between some quick copy/pastes and hours of rewriting value lists and such.  I thought Will did a very thorough job with all those considerations; his article can save you a good bit of time.

http://www.experts-exchange.com/A_4722.html
0
 
rvfowler2Author Commented:
Thanks, I already have used Will's article.  It's just that my files are so complex in their TO relationships that I need to be careful not to impact business.   And yes, Will also considering moving interface elements to a central file, but want to think through any ramfications.
0
 
Will LovingPresidentCommented:
You can actually try it without changing your existing system. Just duplicate the interface in the main file but don't give users access to those layouts until you've tested it sufficiently.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now