Jump 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.

Script jumps to the last record

Featured Replies

  • Newbies

Hi everyone -

First time post.

I'm using buttons to run a script to simply go to a layout. I've created scripts that go to the layout, which when I run them using the key command work fine - ie they stay on the record I'm on. But when I call them from a button, they go to the layout but also jump to the last record in the database. It also goes to the last record when I have the button recall the layout directly. Any idea what I might be doing wrong?

Thanks!

Without the script, one can only guess, but...

is it possible that the layout is built on an unrelated table? Without a relation, FM behaves differently than if there is one.

David

I'm hardly an expert but I had a similar problem and I found using the 'Go to related record' script step rather than 'Go to layout' cured it. As T-Square says, however, it depends on your circumstances. Give it a try and see if it makes a difference.

Using Go to Layout[] does not by itself change the record of the target table occurence. But it's important to remember that each table occurence can have its own found set (and selected record). So if you jump to a layout based on another TO, the current record could indeed change.

This is a separate issue from using Go to Related Records[], where the found set in the target TO may or may not change based on the use of the "Show only related records" option. And the relative position of the current record may or may not change depending on the Sort option of the relationship.

Indeed, it would be helpful if we could actually see the problem script (either detailed text--enough to identify the TOs, or a screenshot or PDF that has all the details).

  • Author
  • Newbies

Thanks everyone for your ideas.

It turns out that the problem was that I'd put the button with the "go to layout" command (and that was all that was in the script) in a trailing grand summary and not a footer. Once I put it in a footer, it stayed on the record it had been on previously instead of jumping to the last record.

Why the TGS does this I'm not sure. I bet someone else here is! But fwiw, that's what fixed it for me.

And thanks for your ideas!

Create an account or sign in to comment

Important Information

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

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.