August 18, 201015 yr 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?
August 18, 201015 yr 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.
August 18, 201015 yr 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.
August 18, 201015 yr 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?
August 18, 201015 yr 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 August 18, 201015 yr by Guest
Create an account or sign in to comment