October 21, 200619 yr 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!
October 21, 200619 yr 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
October 22, 200619 yr 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.
October 22, 200619 yr 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).
October 22, 200619 yr 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