What are the navigational elements used in the autocomplete rule editor?
Hello, my name is Ken. In this video, I’ll explain the navigational elements used in the autocomplete rule editor.
Once you are inside the Rule Logic section to start building a rule, you are by default presented a variable definition. You cannot delete this until you have added at least one more rule line. The rule logic editor does not allow for any free-form typing of logic statements. It also does not allow 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 cannot reference a variable or a field of a related object before first declaring it within current scope of rule logic.
There are three navigational elements in the rule editor to help you build the rule: down arrow, XYZ icon, and hyperlink.
The down arrow is the main element to add or delete rule lines. It 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. 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.
When you click the left most indented down arrow, you can see these menu options:
-
Add next if there's a possible path for the rule logic to proceed; it won't be displayed after a guaranteed execution of an Add error statement, for example.
-
Add before except for the first line of the rule logic.
-
Delete except for the only line remaining in the rule logic.
-
Add else block, this option is available only for down arrows next to the If clause for the entire If block when the Else portion is already removed.
-
Delete else block only for down arrows next to the If clause.
Within each of the primary drop down menus, you have the following options:
-
Add a new variable type.
-
Assign value to variable.
-
Assign value to field.
-
Add condition block.
-
Add error message 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.
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 five operand types, different from data types. By default, one of the operand types is picked for you by the Editor. Therefore, you can pick up to four additional operand types.
The first operand type is Literal. Literal is the 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.
The next operand type is Business Attribute. It is a field on any object, current or related. After changing to this type of operand, you can use the hyperlink to pick the attribute from the current object or a list of objects you have given yourself access to.
Function is the next operand type. 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 on the first default available function.
The next operand type is 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 certain cases like:
-
When you want to concatenate strings to show as part of an error message.
-
When you want to 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.
The last operand type is 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.
The final element for navigation inside the autocomplete editor are the Hyperlinks. You can click on any hyperlink to see a list of available options. Hyperlinks can show up in many contexts. In all cases where a hyperlink is available, the component shows up in blue color and the cursor in most browsers will automatically detect it as such.
The most common hyperlinks contexts are:
-
A Business Object Attribute: This hyperlink when clicked will show you alternative fields from current or related objects that you declared yourself access to.
-
An Operator: Part of an expression, clicking on this operator will allow you to pick from alternate types of operators available but limited to the context of the expression.
-
A Function: Whenever an operand of type function is selected, clicking directly on the name of the function will allow you to pick from any additional available functions, again, for the context of the equation or expression.
This concludes the explanation of the navigational elements in the autocomplete rule editor.
Thanks for watching.