Adding Back Buttons

One of the most valuable features you can incorporate into your Claris/FileMaker solution is a back button. This feature is deeply ingrained in every individual who has ever used a web browser. It represents the common scenario where your mind recalls the previous location and seeks to return to it. However, the challenge lies in the complexity of your solution's navigation system. Without careful attention to simplifying navigation, there can be an overwhelming number of options that most people struggle to remember.

This video focuses on implementing a few relatively simple scripts which can greatly enhance the usability of your solutions. Providing end users with the ability to retrace their steps and easily return to their starting point is an invaluable offering. The beauty of this feature is that once it's integrated into your solution, it will seamlessly work. It will track and remember the desired state information without any additional effort. All you need to do is add it to your solution.

If you are building a complex system, which is the case for most solutions, incorporating a Back Button feature is an obvious choice that requires no second thought.

AttachmentSize
InvoiceSolution-BackButton.zip3.49 MB
Tags:

Comments

I wanted to add this because even Matt is confused about terminology that relates to data structures like stacks - these are simple structures that have been in use for at least 60 years but don't get talked about much outside of a computer science degree because they involve very low-level details that don't really matter for tools like FileMaker.

The early structures were based on ideas that can be mirrored in what we call the "real" world, so it helps to think of common situations that are analogies to the digital concepts.

Think of a stack of plates. You place a new plate on top of the stack, and when you fetch a plate you take it from the top of the stack. The terms "push" and "pop" are used for the digital structure, but the actions are the same; you're only ever dealing with the first item. This makes a stack nice and fast, since you only ever care about one memory address. A stack is "Last In, First Out" (aka LIFO) and is useful when you want to deal with events as soon as possible after they occur.

Now think of a line of people: a queue. When you add an item to a queue, social etiquette prescribes that you only ever place the item at the end of the queue and you only ever pull an item from the front of the queue. You still can use the terms "push" and "pop" but because of the nature of the data structure, _their implementation changes_. A queue needs to track two memory addresses, the "head" and the "tail", and is a "First In, First Out" structure - you use a queue when the order of the events is important. Every item in the queue also needs to track the address of the item behind it: when you pop an item from the head of the queue, the item that _was_ behind it becomes the new head. Queues have more overhead than stacks, but since they store the order as well as the data the overhead is almost always worth it.

Now think of a shopping list written on a piece of paper. You're following many of the same conventions as a queue when you add items, but sometimes you will add items based on a particular grouping (e.g. you write down milk early in the list, but when you want to add eggs to the list you write it between milk and the following item because you know that in the store they are right next to each other). The digital equivalent is known as a _linked list_ and you use a linked list when the order of PROCESSING is more important than the order of OCCURRENCE. The flexibility of the linked list comes at the cost of more overhead: each item in the list needs to know the address of the item ahead of it AND the item behind it, plus it's more complex to add or remove an item because you need to update additional items based on the position in the list. But it's worth it because you store the _priority_ of the items.

Linked lists are in some ways the first of the basic data structures that is better in digital form than in the physical world, and thus don't map easily to our learned experience. But they are slow, because you need to traverse the list from the "head" item to locate the point where you manipulate entries. So new data structures were invented to improve the speed - I won't go into detail here, but the idea of storing the memory address of each item separately (aka creating an index) is what ultimately lead to the development of database systems.

I hope this has been helpful.

--
Daniel Farnan

Ignorance is curable, not preventable

Thanks Matt for informative video. When trying to have an icon to FMP, I could not get the SVG file saved from text editor (MacVim or BBEdit). Is there a trick to have the file saved as a usable svg? Thanks. Candido

Candido Tomás
Cleodora

It works but only if you use a single window. In my solutions it would be typical to open a second window to deal with someone interrupting your data entry and asking for the price of something, they'd open a new window and look it up. It's not unusual that people have 5 or 6 windows open at once on my solution. If I open multiple windows on the example I end up with the back button moving back in the wrong window. In my solutions I use the repetition to define my globals per window number. I currently don't remember panel values, but I may do now, I guess adding 1000 to the window number + the object ID could work to get a unique repetition for both. Anyway, if you're looking for topics you could do a part 2 for multi windows!

you mention download sf symbols but there is no link or description how to get it

please show how to do this

Thanks

Peter Cortiel

I just downloaded SF Symbols from the developer website, and I read the license. Unlike Filemaker, the SF Symbols license is NOT cross-platform. Symbols taken from here can only be used on Apple devices (iPhone, iPad, Mac). So, if you have Windows users, per the license, they cannot use any of the icons from the site. That is disappointing given Filemaker is an Apple company.

I've implemented the Back button and that's all dandy, but figured it'd be equally fun to adapt it to go forward too (i.e. return "back" to the view/s you just came back from)

Script-wise I've got it all working: when you go back, the ID is added to a STACK.FORWARD global in the same way as Matt's etc.

But where Matt's Back solution works fine, my adapted Forward solution seems buggy – sometimes going to the layout but sometimes not. The ID is added and popped off the list as expected and the script throws up no errors, just the Go to Layout doesn't always go to the layout. Maybe 20% of the time. And there's no rhyme to when it does/not work.

I can see in the data viewer that it's retrieving the right ID and feeding it to the forward script as expected, and given that the Back works fine and the Forward is buggy it's gotta be something stupid that I've done, but I can't see it. Any suggestions on a stupid obvious thing I've done wrong?