Database Reference
In-Depth Information
POWER USERS' CLINIC: PASSING MULTIPLE PARAMETERS
A script can have only one parameter, and its result type is always text. But the parameter itself can
be multiple values, if you're willing to use your calculation skills. To pass multiple parameters,
string your values together with a separator character and then pull them apart again in the script.
For example, if you want a script to have a pair of static values, you could type this text as the script
parameter:
Molly¶Bloom
Since the separator is the , each value is on its own “line,” and that makes it easy to grab the bits
you need using the GetValue() function. A calculation to pull “Molly” out from the script paramet-
er would look like this:
GetValue ( Get ( ScriptParameter ) ; 1 )
Here's how to assemble a set of dynamic values into one script parameter:
Customer::First Name & "¶" & Customer::
LastName & "¶" & Customer::Phone & "¶"
& Customer::Email
The GetValue() function above can pull apart the pieces of your multivalue parameter.
Script Variables
You use global fields to store a value that's not tied to a specific record in a table. Script vari-
ables are similar; use them when you need to store a temporary value for your script to use,
like when when you're testing a condition. But variables are better than globals in one im-
portant way: You don't have to add a field to a table to use them. Instead, variables are cre-
ated as a script is running and can vanish again when the script is finished, leaving no impact
on your data's structure. (See The Let() Function and Variables for a refresher on using cal-
culations to create variables.) Figure 17-14 shows you the Set Variable script step used in
the Custom Layout Dialog Box script. It grabs an Invoice ID so it can set it in the new Pay-
ment record that's made a few steps later in the script.
Search WWH ::




Custom Search