Autocomplete Rules Editor

These are the key features of the editor.

  • A variable definition is displayed by default and you can't delete this until you add at least one more rule line.

  • The rule logic editor doesn't allow any free-form typing of logic statements.

  • The editor doesn't enable you to copy-paste rule lines. This is to ensure certain logical ordering of rule lines, which is built into the logic editor. For example, you can't reference a variable or a field of a related object before first declaring it within the current scope of rule logic.

  • The 3 navigational elements in the rule editor: down arrow (1), xyz icon (2), and hyperlink (3) help build the rule.

Autocomplete Rules editor

Down Arrow

This is the main element to add or delete rule lines. You can add a rule line before or after the current rule line or block. At the left of a rule line, using the down arrow you can operate on the main body of the rule logic.

The down arrow is at the beginning of every rule line whether leftmost indented or indented further within a rule instruction. The down arrows that are further right indented allow you to operate on specific sections or blocks of the rule line. Let's look at the additional functions along with the context in which they occur as we cover all types of rule lines.

When you click the left most indented down arrow, you can see these menu options.

  • Add Before (except for the first line of the rule logic)

  • Add Next (if there's a possible path for rule logic to proceed; won't be displayed after a guaranteed execution of a Add error statement, for example)

  • Delete (except for the only line remaining in the rule logic)

  • Delete Else Block (only for down arrows next to the If clause)

  • Add Else Block (only for down arrows next to the If clause for the entire If block when the Else portion is already removed)

Within each of the primary drop down menus, you have the following options -

  • Add variable

  • Assign value to existing variable

  • Assign value to business object attribute

  • Add a condition block

  • Add error (for business object validation, field validation rule type only)

  • Add warning (for field modification rule type only)

  • Call a function

  • Add row collection looping block

xyz Icon

The second navigational element of the Autocomplete Rule editor is the xyz icon. This icon is immediately to the left of an operand, which is part of either an expression, an equation, or a function. All variable definitions are essentially an equation and the xyz icon will be immediately to the left of any operand (and on the right hand side of the equation).

In an expression, the xyz icon is next to each operand while in a function, it's immediately to the left of any argument or parameter passed to the function.

You can change the type of operand or argument using the xyz element. Autocomplete Rules supports 5 operand types, different from data types. You can pick up to 4 additional operand types. These are the operand types.

  • Literal - Default operand type for the right hand side xyz operand for any variable type definition equations, most expressions, and most arguments of functions. In most cases, a literal operand type shows up as an empty text box that requires an input in the expected data type for that field. One exception to this is the right hand side operand of an expression in which the left hand side is a business attribute of type LOV. In this case, the literal automatically shows you a list of valid values for the LOV.

  • Business Attribute - Field on any object, current or related. After changing to this type of operand, use the hyperlink to pick the attribute from the current object or a list of objects you have given yourself access to.

  • Function - If the left hand side operand data type supports a function that returns a value of the same data type, changing to this type of operand then enables you to select the functions by clicking the first default available function.

  • Arithmetic Expression - If the left hand side operand data type supports an arithmetic operation on a combination of operands in right hand side, you can change to this type of operand. This operand type is used in these cases.

    • When you want to concatenate strings to show as part of an error message.

    • When you want show arithmetic operations - add, subtract, multiply and divide operands of a like data numeric data type.

    • When you want to use it in date calculations that allow you to add or subtract a given number of days from a date to determine the desired date in the past or in the future. For example, current date + 90 days

  • Existing Variable - When you have already defined a variable of a given data type, changing an operand to this type enables you to substitute the right hand side operand to an existing variable of the same data type as that of the left hand side.

  • Nullify Value - Assign a null value to any type of field or variable. But, if you try to nullify a variable already used in the rule, a warning will be displayed.

Hyperlink

The blue hyperlink component is contextually available to access a list of options. You can freely click any hyperlink to see a list of available options. This isn't a literal hyperlink, where you will be linked to another page or component. In cases where a hyperlink is available, the component shows up in blue color. These are the common contexts where hyperlinks are seen.

  • Business Object Attribute - Click the hyperlink to see alternative fields from current or related objects that you can access.

  • Operator - Click the operator, part of the expression to select from the alternate types of operators available, but limited to the context of the expression.

  • Function - Click the function name to select any additional available functions, but limited to the context of the equation or expression.