Salesforce

Expression Editor (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Expression Editor (Magic xpa 3.x)

You can access the Expression Editor by selecting Expression Rules from the Task menu, pressing Ctrl+E, or by zooming from any expression field.

The Expression Editor is a modal window that lets you enter and display expressions in a table format. You can access various Selection lists from the drop-down menu, by using the shortcuts or by clicking on the icons at the top of the window:

Button

Description

Shortcut

Variables

Ctrl+`

Functions

Ctrl+1

Internal Events

Ctrl+2

Shortcuts

Ctrl+3

Rights

Ctrl+4

Controls

Ctrl+5

Data Sources

Ctrl+6

Programs

Ctrl+7

Errors

Ctrl+8

Menus

Ctrl+9

Forms

Ctrl+0

Logical Names

Ctrl+minus

By default, the Variable pane is available on the right-hand side of the window. You can press F5 from the Expression Editor to reach the Variable list. You can also search for a function using the search field at the top right of the window.

An expression is a constant or a formula for computing a value, consisting of a sequence of operators indicating the action to be performed and operands on which the operation is performed. Operands may contain variables, functions, literals, or other sub-expressions.

The order of the expressions in the expression list is not important.

If you want to create a line before the current line in the Expression Editor (including creating a new first line), press Ctrl+Shift+F4. Since version: 3.0

Each entry in the Expression Editor evaluates to a Numeric value, an Alpha string, BLOB, or a Logical value (TRUE or FALSE), depending on the type of variable and functions used.

If an invalid combination of types is used, Magic xpa displays an error icon to the left of the expression. A tooltip describes the error. Since version: 3.0.

You can also check your expressions by clicking the Validate button. Since version: 3.1

When working in a Rich Client program, characters will appear to the left of the expression in the Expression Editor indicating whether the expression is client-side, server-side, or mixed. For additional information, see Rich Client Server/Client Handling.

Strings

A string value in an expression must be surrounded by a single quotation mark (for example: 'abc').

To get the value of a single quotation mark character, you should use a sequence of two single quotation marks inside another pair of single quotation marks. For example, the value of 'it''s' will be treated as it's.

A double quotation mark (") is considered a regular character.

Functions

Functions can be nested to any level using parentheses. For example, Len(LTrim(RTrim(A))). Further complexity is possible by nesting logical expressions by using IF, AND, NOT, and OR. Magic xpa removes any superfluous parentheses.

You can enter any arithmetic expression that follows conventional algebraic rules, or a string or a logical expression.

A function usually contains one or more arguments, delimited by commas. The argument list is enclosed in parentheses. Even if the function contains no arguments it still requires a set of parentheses: for example, Date ().

Every function returns a value.

The function names in expressions are not case sensitive.

Multiline (Wide) Mode

You can expand the expression field so that the expression is displayed in a multi-line text area.

You can copy all or parts of the expanded text.

You can move to Multiline Field mode by:

  • Pressing F6

  • Exceeding the limit of the expression line

To exit the multiline mode, press F6.

When you are working with long expressions in multiline mode, you can select Word Wrap by clicking the icon at the top of the window. When you select this option, every line that exceeds the line's displayed width is wrapped to the next line. Since version: 3.2a

Function Tooltip

When you have typed or selected an internal or user-defined function with parentheses, a tooltip appears just below the expression and displays that function’s parameters. When you have completed the function’s syntax, the tooltip disappears. The tooltip also displays the attribute type the function returns.

The tooltip closes when you press Esc or when the tooltip time has expired.

For user-defined functions, if Magic xpa is unable to determine the return value, the tooltip displays, “Returns Variant”.

Related Topics

Reference
Attachment 
Attachment