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.

Loop layouts dynamically

Featured Replies

I have a number of help layouts. They have graphical components so am unable to create them as simple text fields/records, rather there are a number of individually numbered layouts with the various help screens. All of the help screens are named HELP_#. I will be adding to them at anytime. Each one can be individually opened via the ? on screen with a go to layout (HELP_ + get(scriptparameter))

I am trying to create a script that will dynamically loop through all of the help layouts and print/append them to a pdf.

Everything is working fine, with the exception that the go to layout step will not work. The calculation works fine (i.e HELP_02 should be the next layout) but the blimmen thing just won't go there :

Here is my script so far


Go To Layout Help01

Set Variable $$filename

Set Field [gcounter right(get(layoutname);2) + 1]

Save records as PDF $$filename

Loop

Go to Layout "Help_" & if (gcounter < "10"; "0"; "") & gcounter  **this pads the number with a 0 if less than 10**

Exit Loop if "Help_" & if (gcounter < "10"; "0"; "") & gcounter <> get(layoutname)

save records as pdf [color:red]*appended[/color]

set field gcounter right(get(layoutname); 2 + 1)

End Loop

I've also tried variations of getasnumber/getastext with no help :

So essentially the script needs to

HELP_01 *print

HELP_02 *print

HELP_03 *print

and so on, until the next number e.g HELP_04 doesn't exist so the script exits.

TIA

Try:


Go to Layout [ “HELP_01” ] 

Save Records as PDF [] 

Loop 

Exit Loop If [ IsEmpty ( FilterValues ( SerialIncrement ( Get ( LayoutName ) ; 1 ) ; LayoutNames ( Get (FileName) ) ) ) ] 

Go to Layout [ SerialIncrement ( Get ( LayoutName ) ; 1 ) ] 

Save Records as PDF [] 

End Loop 

Go to Layout [ original layout ] 

  • Author

That worked beautifully. Thanks so much. Didn't know serialincrement existed.

Cheers

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.