Understanding Script Controls

This section describes the legacy process of using Standard Choice script controls to instruct Civic Platform how to perform before and after event activities.
Note: For more efficient script development and deployment, Accela recommends the use of the JavaScript framework (provided in Civic Platform 8.0.1) to implement customizations to the master scripts. See JavaScript Scripting Framework.

Each script control provides parameters to master script functions (Master Script Function List) within a framework of conditional (if-then-else) expressions. A single Standard Choice can contain multiple script controls. The master script evaluates the script controls in the order that the Standard Choice numbering specifies.

Script controls use the caret (^) symbol to delimit the if clause (predicate) from the then clause (consequent) and the else clause (alternative) in a single conditional expression. Civic Platform interprets the first clause as the if clause, the second clause as the then clause, and the third (optional) clause as the else clause.

Each clause in a script control calls a master script function and provides parameter values required by that function. The variables associated with the scriptable event () determine the scope of possible variables that the script control provides to the master script function.

Enclose master script function parameters in parenthesis. Use a comma to delimit master script function parameters. Enclose string parameters in double straight quotes. JavaScript Primer provides additional Javascript syntax elements you can use in script controls.

Example Use Case

Script Control Syntax shows a single script control. This script control says, “If the current record type is not a Building/Reroof type, then assess but do not invoice all of the fees from the fee schedule called BLDCR05.” The master script function that the script control calls,
appMatch
for example, provides a return value, in this case true or false, to determine whether to perform the function in the then clause.

Figure: Script Control Syntax



Example Use Case

Script Control Structure (if/then/else) says, “If Acres Disturbed is less than 5 then assess but do not invoice the SMALLACRE fee, else assess but do not invoice the BIGACRE fee.”

Figure: Script Control Structure (if/then/else)