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.

Featured Replies

I am trying to create a script to go to a specific field depending on the script parameter assigned to a button. But the go to field (or set field) steps do not give me a calculation possibility to choose the parameter. Any suggestion?

Use the Get ( ScriptParameter) to control your script and direct it to the appropriate field.

If you're using this as a general purpose button then the script could get quite long with all the fields that need to be catered for, however it's all in one script!

  • Author

That is what I did, I have three buttons that go to three different fields, the idea is to use only one script and specify the field name on the button parameter, the problem is on the go to field (or set field) script step where you do not have the possibility to add Get(ScriptParameter), because there is not a calculation condition to choose a field.

You need an If/End If construct for each field:

If (Get(ScriptParameter) = "field1")

Goto field (field1)

Exit Script

End If

If (Get(ScriptParameter) = "field2")

Goto field (field2)

Exit Script

End If

If (Get(ScriptParameter) = "field3")

Goto field (field3)

Exit Script

End If

You cannot target the field on a direct basis using calculated data. I suppose this makes sure that the script will always run as it cannot possibly address a badly named field from calculated data. Maybe you already made this conclusion.

Sorry if you already have this solution but I thought I'd make it clear for others as well.

  • Author

That works, thank you very much

You can make this significantly shorter by using the Else If[] script step:

If (Get(ScriptParameter) = "field1")

Goto field (field1)

Else If (Get(ScriptParameter) = "field2")

Goto field (field2)

Else If (Get(ScriptParameter) = "field3")

Goto field (field3)

End If

Another option is to loop a Go to Next Field[] step, until script parameter matches Get(ActiveFieldName). Neither is very pretty, but..

But a problem with these apporaches is that they beyond requirering a layout where the field is present, that if the field you need to reach is way down in a long line of tests ...why not make the whole nine yards, and make utility layouts for each field you need to reach.

Although a little tiresom for the developer to establish, will it give the exact same responsetime no matter which field.

Freeze Window

Go to Layout [ Evaluate(Get ( ScriptParameter )) ]

Go to Field [ ] [ Select/perform ]

Go to Next Field

Insert Calculated Result [ $aVar ] [ Select ]

Go to Layout [ original layout ]

Commit Records/Requests [ Skip data entry validation; No dialog ]

Borrowing boldly from this post.

...or checkout my attempt to template it...

--sd

mulitplex.zip

Using Else If[], is there a noticeable difference in response between the first test returning true, and say the 25th test? Enough to dedicate 25 layouts to this?

(Of course, with proper data structure, this shouldn't be required at all.)

(Of course, with proper data structure, this shouldn't be required at all.)

Are you taking my lines in the script, as well?? What you need to address as well is the use of repeating and global fields

I could have used you echoing in this thread:

http://www.fmforums.com/forum/showtopic.php?tid/176126/post/203515/hl//#203515

--sd

For echoing, I believe this will serve you so much better...

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.