Make sure in your script you have your SETVAR (see below) setup. It should be setup the same way as the variable in the view.
If you are using a multiselect, you need to also select quote values in the variable tab of the script.
Please let me know if you need more information...
Placing Variables in a Script
Variables can be used in a script in many different ways to provide user input for almost anything. When placing a variable in a script, the variable name must be proceeded by an ampersand(&).The variable can be the same name as the view variable or be unique. Once a variable is placed in the script, it must be defined before the script can be run.
Below are some example script lines that show three areas where variables are most commonly used: SETVAR, SQL and Command Parameters.
Each of the examples is followed by some general rules or guidelines for the syntax of the variable. These are not ‘hard and fast’ rules. There are many ways syntactically to use the variable, but these guidelines will help to avoid errors in most cases.
A very powerful use of variables is the ability to pass user input into a Sequel view using the Set Variable (SETVAR) parameter. Most Sequel commands that generate output (Display, Execute, Print, Report, etc.), have a SETVAR parameter for this purpose.
The SETVAR parameter will contain pairs of variables. The first variable in the pair is a variable defined in the view – the variable user input will be passed to. The second variable is the variable defined in the script – the value that will set the view variable. For example, &TEXT is the view variable and &EXPR is the script variable.
DISPLAY VIEW(SEQUELEX/CUSTLISTX2) SETVAR((&TEXT '&&EXPR') (&FILE '&&NAME')
(&CUSNO '&&NMBR') (&CSTTE '&&QSTNG') (&DTE '&&DTE'))
The SETVAR above has five pairs of variables. Each represents the five different . Quoted String and Number type prompts are used most often to pass input to the WHERE clause of the view for record selection purposes.
As a general rule, it is best to use single-quotes around the variable in case the value has spaces or punctuation, inside the SETVAR parameter. When a script variable is enclosed in quotes, two ampersands(&&) are required to ensure substitution.
Originally Posted By jdaugherty