Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5212 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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?

Posted (edited)

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

This topic is 5212 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.