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

Hi, I am trying to develop best practices with scripts and variables, can you please answer the following:

1)Are variable names case-sensitive?

2)Is it good practice to pass named script parameters (e.g. a=5) and what's the best way to distinguish them (; or CR)?

3)Am I correct if for any executed script that has parameters I set variables that split up those in order to use them inside the script?

From what I've read from FM-Help a method for this is:

Evaluate("Let([" & Get(ScriptParameter) & "]; variable)")

Does anyone agree/disagree?

Is there any free resource you know for developer's best practices?

4)If you perform a script to open a modal window using a Loop and a Pause [indefinetely] until Exit IF is satisfied, is it possible to pass any variables from this script to any script additionaly triggered from the layout (e.g. OnModify) to be used as well?

The variable name case sensitivity is easy enough to test yourself.

As for 2) any parameter delimiter should be chosen to be a character that will not be in the values themselves. One advantage of using CR is that the built-in value handing functions can be easily used for parsing them.

3) I have no idea why you're using the Evaluate function. I don;t think I would consider that best practice.

  • Author

1)Are variable names case-sensitive?

Ok, found this one in FM Help:

A variable name has the same naming restrictions as a field name.
  • Author

I was thinking of passing parameters to scripts like:

window=modal

IDField=pkLineItemID

...

I was thinking that in this way I could minimize the number of scripts I will be using by changing only specific variables.

Using the Evaluate() I would easily parse the "pkLineItemID" string from the example above to set the variable inside the script along with a Get(LayoutTableName) function and a "::" connector in a SetFieldByName script step.

To put it simply, it would help me sort out which parameter should be which variable inside the script.

What do you think?

You can pass names variables in a script parameter like this;

"

Let ( [

$id =Customers::)_pk_cusID;

$action = "View";

$$doc = "Contract"

] ; "" )

"

Then you would use Evaluate("Let([" & Get(ScriptParameter) & "]; variable)") in the beginning of your script.

This can be used to set local or global variables.

Edited by Guest

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.