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.

making script parameters dynamic

Featured Replies

Maybe this isn't possible but I thought I would ask. I am trying to make my script parameters "dynamic" so if you loop through records, the calculation in the script parameter works for that record. However, it seems to be a static value that gets passed once.

I wrote a custom function to capture all parts of an email and want to use that as multiple script parameters. Then I can use one email script and pass different calculations into the email body, etc. However, it seems like the parameters pick up the first record's info. and then that's it...even if I call the parameters again in a loop. Hmmm. Am I doing something wrong or is this not possible??

Out of curiosity, if you are using FM8 why arent you using variables instead or in conjunction with Script Parameters?

  • Author

I wanted to avoid variables for one reason. I have so many specialized email bodies with calculations that I would have to have a variable for each one to pass into the email setup. I also have to specialize the setup for several different depts. since the TOs are different. I was thinking that if I could pass the calc through a parameter, that would help my sanity.

I'm not aware of how to change the parameter once inside the script, but it's certainly possible to pass multiple values with one parameter, under certain conditions.

Supposing that each value is one word long, separate each value with a carriage return. Then in the script, use the MiddleWord function to extract out the "word" that is needed. I can explain in more detail if this is what you were looking for.

  • Author

I already have multiple parameters set up - no problem there. But I am not passing static words - I need to pass dynamic calcs. So, once the parameter is passed for the first record, there is no way to make it dynamic for the second record - even if I have it call the parameter in a loop.

I don't quite see why you can't use a single script variable in the same way as you use the script parameter.

However, you can change the script parameter by calling the script with a new parameter in a loop, something like:

Go to Layout [ "TableA" ]

Show All Records

Go to Record/Request/Page [ First ]

Loop

Perform Script [ "SingleStepSubScript"; Parameter: TableA::Source ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

Could you pass the calculation as a parameter in quotes, and then use the Evaluate() function?

i.e. DoMyScript( " "Max(Table1::Field1, Table2::Field2) " )")

Then, to use this set up a calc field which is

myfield = Evaluate(theparameterfield)

Edited by Guest

  • Author

that did the trick! passing the parameter in quotes and using the evaluate worked like a charm.

Thanks!

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.