Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Go Back script

Featured Replies

Hi, I,m trying to make a Go Back script that is going to be attached to a Back button but for some reason it acts very weird AKA sometimes when I'm on a layout in preview mode it will turn the layout in browse mode... Err ok I found out why, it was pretty dumb on my part...

Here's my script:

Allow user abort(off)

Go to layout (original layout)

Enter browse mode

Toggle window maximise

The back button doesnt go back at all, it always stays on the same layout.

How can I make the back script to go to the previous layout AND enter the default mode of that layout?

Thanks

This is actually a fairly advanced topic. It's discussed on pp. 362-366 in Chapter 13 of Using FileMaker 7--sample code is shown on pp. 364-365. I imagine that it would be even more involved to do in version 6.

  • Author

Are you serious? I was under the impression that I was just being really dumb and that it was a fairly simple script...Time to buy some books and start reading!

Aside from Using Filemaker 7, is there any other great books about FM7?

I assumed you meant a real "Back" button--which would take you all the way back to the beginning of a session, regardless of how many layouts, tables, etc. you went through.

Go to Layout [original layout] refers to the current layout when the script was called. You would have to store the desired layout number in a global and use the 'layout number from field' option.

  • Author

Thanks, it partially works now.

It always brings me back to the same layout.

Let's say I have 6 layouts, A,B,C,D,E,F

If I go from A to D and hit back, it brings me back to A no problem.

But it always brings me back to A no matter if I was on F and went to B...

I have my global field named Last Layout and set to "number"

and in my "Go Back" script, I have Go To Layout ("Last Layout") specify: layout number from field

I'm having a hard time trying to find out whats wrong...

You have to set the global via script every time you change layouts and want to make 'this' layout the one to which it should return.

  • Author

Do you mean calling:

Set Field(Last Layout)

on each of my scripts that allow me to change layouts?

Maybe I'm calling the wrong value (Last Layout) but I just tried it and it

doesnt work. confused.gif

I have a global text field: gt_sys_CalledFrom

I use a set field step to give it the layout name that i am about

to leave (to go forward)...set field calledFrom to CalledFrom & ScriptParameter & "@" (the layout name is passed by the script parameter.

Then when i want to go back, i just find the last pair of "@" and use

a gotoLayout by name calculation to return to the proper layout.

I then remove the last layout name, so that nested "go backs" will work

Dan

I mean using Set Field [globallayoutnumber, Status(CurrentLayoutNumber)]. You could also use Dan's technique to track multiple layout changes, but you would not be able to use the script parameter. You could, however, use Status(CurrentLayoutNumber) or Status(CurrentLayoutName) to set a global text field appropriately.

Vilem:

So your problem was much simpler than I imagined. Just do as -Queue- says above. In the future, if you need a real Back button to travel back through all the user's choices, see the reference I gave.

  • Author

I ordered Using FM7 this very morning! grin.gif

Almost everything works now, I am able to go back to the previous layout no problem, there's one itch though,

when I'm on a layout that is in preview mode and I decide to go back to a layout that is supposed to be in browse mode, it unfortunately puts it in preview mode.

Do I have to store the layout mode in a different global field as well?

Just add a script step to Enter Browse Mode at the start of each script - that way you know where it starts from.

  • Author

Attach Enter Browse Mode to each of my scripts that enables me to navigate through my layouts?

How would that effect my back button since the only thing that the back button makes is going back to the previous layout. It doesn't execute the usual script that makes me switch from a layout to another.

The way I see it at the moment is that I would have to give my back button a series of conditions like:

If

my previous layout is Labels

then enter preview mode...

But there must be some way to simplify this, like I asked a few posts up, is it possible to "store" the mode of a layout in a global field just like I did for the layout?

Sure: use the Get(WindowMode) function (in 7) or Status(CurrentMode) (in 6). yay.gif

  • Author

Thanks a whole lot Transpower!! grin.gif

  • Author

Ok I'm beginning to understand FM scripting,

So I've setup my go back button and it works fine now, it brings me back to the previous layout grin.gif

I've also setup my global field in which I store the mode of the layout, I have also put the Set Field in the appropriate scripts.

Only 1 problem remains, how do I call that field in my go back button script?

Calling the layout number was fairly easy, I only had to make the script go to the layout "globallayoutnumber", but I cannot find the equivalent script for the layout mode.

You don't call the field, you test its value.

If [not globalfield]

{window mode is zero - Browse}

{do something}

Else

If [globalfield = 1]

{window mode is one - Find}

{do something else}

etc.

End If

End If

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.