Invalid Expression error is issued in the following situations:
Division by '0' (zero)
You are trying to divide by 0.
Fix the expression that has this division by 0.
Non-terminated 'Text' literal
You are not handling a Text literal properly.
Fix this Text literal in your expression.
Element <element> does not exist in the expression Scope
The syntax of the expression is correct, but it's using an element that either does not exist in the module or is not available in the expression scope.
Check the Scope Tree of the expression and select the desired element from there.
Syntax error caused by unexpected <element> in expression
The syntax of the expression is not correct. For example, you are not using an operator correctly:
MyVar = + VarAux + 2.
Expecting <element> instead of <element>
The syntax of the expression is not correct. For example, if you do not end a function call properly, with a right-parenthesis:
Check your expression to validate its operands, operators, and variables.
Parameter 'parameter' in function 'function' is mandatory and must be specified
You are invoking a function with no argument for a mandatory parameter.
Check the Built-in function or the User function definition, to validate which input parameters are mandatory.
Too many arguments specified for function '<function>'
You have mapped more arguments in the function you're using than the number of parameters that it actually has. Or, you're using at least one named parameter that advanced the position of the corresponding argument, so the continuous arguments exceed the available number of parameters in the function.
Check the Built-in function or the User function definition to validate its arguments and the function calls syntax.
Too many levels of nested function calls
You are invoking functions within function arguments successively, exceeding the maximum number of levels (20) of nesting that is allowed.
Replace some of the function calls by Variables where their value has been previously assigned invoking the necessary function, in the action flow.
Unexpected argument named '<parameter>' in function '<function>' call
The syntax of the expression is correct, but it has an argument for a parameter that does not exist in your function. Probably you've deleted this parameter from the function and have not "clean up" your expression yet.
Check the Built-in function or the User function definition, to validate its arguments. In case you've actually deleted a parameter, fix the expression errors. Right-click the error line to see the fixing suggestions OutSystems provides you for this error:
Create <function> Input Parameter: Creates the argument in the
Delete Argument: deletes the argument from the current call to
Delete All Similar Arguments: deletes the argument from all calls to
Argument named '<parameter>' was specified more than once in function '<function>' call
You have more than one argument in the function call to the same parameter.
Check whether you're using the same name more than once or if you already mapped the argument by position and then used its name again in the call.
'<function>' function cannot be executed in the database, so it can't receive any attributes from the aggregate as parameter
You are using a user-function or built-in function that does not exist in the database.
Change the function to use a parameter from outside the aggregate.
Set only one value for the attribute <attribute>.
You entered a textual inline record, but you specified value for an attribute more than once.
Double-click on the error line to take you directly to the invalid expression.