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.

Button selection problem

Featured Replies

Hey,

I have a layout that when in browse mode is displayed as a list of records. I want to create a button on the list that will allow the user to print / preview, the related report. I set it up so there is an icon on the list (meaning that the icon appears repitiously down the screen... not a big deal). But when I write the script to have it go to preview mode and print... it always previews record 1, not the record from which I selected via the icon.

I was trying to modify the script but I didn't see a "select this record" type command...

can anyone help me? or give me a different method of choosing from teh list view to print?

Much Thanks... Vandy

If you insert a Print Setup step in your script and specify the Print Current Record option, it should work.

If each record takes one page when printed, set the current record number to a global before entering Preview Mode, using Get(RecordNumber). Then after you enter Preview Mode, Go to Record/Request/Page [by calculation: your global field].

  • Author

Hey Queue,

This means I got to create a new global field and set it by calculation Get (RecordNumber), right? I haven't used globals that much...

  • Author

Well, I thought about it and tested it out a little and I don't think it will work using globals. My number system consists of a couple of things, a <year code>, form type, <serial number>... but those are reset each year so you could see 2004 Form A 001, 2004 Form A 002... but then 2005 Form A 001...002, etc.

If I use a global it won't reset and I think if you searched it would be confused because if it only looked at the serial, there could be more than one "23".

Any ideas?

  • Author

So I was experimenting and this is what I've found. I made another button that doesn't perform a preset script, but rather just "goes to layout X" and "Enters preview mode". When I do th is it works the way I want it to, that is it goes to record 49 (or current record) when I press the button.

But when I write a script to do the same thing, it always goes to #1.

Why?

Clicking on a button in the record in a list should select that record, then carry out script steps.

Some problems could be:

insure that the button is in fact not extending outside the body area of the list layout.

If you are using portal you will need to go to related record using the same relationship as the portal. If your layout is a list view option layout then all of the found set will be shown in preview starting with record 1.

Rod

  • Author

I see.... I was thinking a bit ago that the whole problem seems to be going from a selected record in browse mode (list) to the preview mode. But according to your last post, if you are in browse/list mode, that is essentially a "found set" of all records so it would naturally start at one.

Okay, if that's the case, now I have to figure out a way to make that jump from Browse/list mode to selecting the record to entering in preview mode with the right record showing.

I could always make the user mannually type in a record, but I don't want to do that. Do you think there is a way I could go from browse/list mode, somehow perform a find, then into preview mode?

I just want to make it easy for the user to look at a list of reports based on a serial number system, and hit a button to print that individual record out and it seems harder than MS Access!

Thanks

  • Author

Okay,

I sort of got it to work, but I was wondering if there is a way to sort of automate the find process. How can I specify the find criteria to equal the current Record ID #?

The global idea should work. It doesn't care what the serial is since it's based on record number, not record id. And it's not a calculation, but a simple number global. It is set with Get(RecordNumber) via script when a record is selected for previewing/printing. Then, when the layout to be previewed is set to view as form, using Go to Record/Request/Page [by calculation: yourglobal] after Enter Preview Mode will take you to that particular record in the found set, assuming each form only takes one page.

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.