Use Rule Builder

Use Rule Builder

You are here:

Product Configurator’s Rule Builder allows you to design and execute rules such as setting values, displaying messages, and hiding/showing options or choices based on specified conditions. Each rule consists of a rule definition with definition lines and action lines. The rule definition is linked to the configuration option.

When the Configurator BOM Designer page loads an item category or existing item, the related rules execute for all configuration options. When a configuration option changes, the related rule executes for the specific configuration option.

Complete the following to create, edit, or delete the rule definition in the Product Configurator:

  1. Navigate to the Configurator Item Categories page in Business Central.
  2. Select the item category.
  3. Select Configurator Options.
  4. Complete one of the following in the Rule Action field:
    1. Create: Select Create… and select Yes when prompted.
    2. Edit: Select Edit…, select Edit, select OK, and make changes as needed.
    3. Delete: Select Edit…, select Delete, select OK, and select Yes.

The Rule Definition Builder page contains the definition lines (evaluation conditions) and the related action lines to execute when the condition evaluates to true or false.

The definition line can be a group or variable. The first definition line in each rule definition must contain a group, this is called the main group. Each group must contain at least one variable or nested group and each variable must be inside a group.

Definition Line Group

The definition line group can be one of the following types:

Group Type Description
Execute All
(Ignore Results)
The rule evaluates all variable and nested group conditions and executes the “when condition is true” actions for the group regardless of the group condition result. The “when condition is false” actions for the group are ignored for this type.
Execute Until True
(Match Any)
The rule evaluates all variables and nested groups as sufficient conditions requiring only one of their results to be true to execute the “when condition is true” actions for the group. If none of their results are true, the rule executes the “when condition is false” actions for the group. If it finds a true result, the rule stops evaluating the remaining variables and nested groups and does not execute their actions.
Execute While False
(Match None)
The rule evaluates the variables and nested groups as necessary conditions requiring all their results to be false to execute the “when condition is true” actions for the group. If any of their results are true, the rule executes the “when condition is false” actions for the group. If it finds a true result, the rule stops evaluating the remaining variables and nested groups and does not execute their actions.
Execute While True
(Match All)
The rule evaluates all variables and nested groups as necessary conditions requiring all their results to be true to execute the “when condition is true” actions for the group. If any of their results are false, the rule executes the “when condition is false” actions for the group. If it finds a false result, the rule stops evaluating the remaining variables and nested groups and does not execute their actions.

Definition Line Variables

Definition line variables can evaluate to either text or numeric values. Specifically for the Product Configurator, the variables consist of the choice code (text) and quantity per (numeric) for the configuration options. For example, if the configuration includes two options with the names LENGTH and WIDTH there are variables for LENGTH.CHOICE, LENGTH.QTY, WIDTH.CHOICE, and WIDTH.QTY. Both LENGTH.CHOICE and WIDTH.CHOICE evaluate to text values; both LENGTH.QTY and WIDTH.QTY evaluate to numeric values.

The variable line creates the condition to evaluate. It includes a “value on the left”, a “value on the right”, and a comparison operator in between. The condition result is either true or false.

Value on the left Comparison operator Value on the right Condition result
5 is equal to 5 true
5 is equal to 10 false
5 does not equal 10 true

Definition line variables can also be set to [USER PROMPT], which opens a confirmation message for the user to select Yes or No. Selecting Yes evaluates the condition to true; selecting No evaluates the condition to false.

When creating a new rule definition, the first definition line defaults to a group, called the main group, and the second definition line defaults to a variable. Complete the following to set the group or variable in the Rule Definition Builder page:

  1. Add the main group and initial variable lines:
    1. Set the Variable / Group Name to the required group type for the main group line.
    2. Set the Variable / Group Name to the required configuration option variable for the variable line or delete the line if a nested group is required.
  2. Select the existing group and choose the Insert Group Below action from the ribbon.
  3. Set the Variable / Group Name to the required group type.
  4. Select the existing group or previous variable and choose Insert Condition Below (adds a definition line for the variable).
  5. Set the Variable / Group Name to the configuration option variable (acts as the “value on the left” in the condition).
  6. Set the Line Condition to the comparison, or relational, operator to use to evaluate the condition.
  7. Set the Comparison Value to the value to compare against the configuration option variable (acts as the “value on the right” in the condition).

Line Condition

When the Variable / Group Name is [USER PROMPT], the Line Condition must be blank and the Comparison Value set to the text displayed in the confirmation message.

The Line Condition can be one of the following:

Line Condition Description
is equal to Returns true if the variable value is equal to the comparison value; otherwise, false. For text variables, the comparison value is case sensitive and requires an exact match with this line condition (e.g., ‘RULE’ is equal to ‘rule’ is false, but ‘RULE’ is equal to ‘RULE’ is true).
does not equal Returns true if the variable value is not equal to the comparison value; otherwise, false. For text variables, the comparison value is case sensitive and requires an exact match with this line condition (e.g., ‘RULE’ does not equal ‘rule’ is true, but ‘RULE’ does equal not ‘RULE’ is false).
is less than Returns true if the variable value is less than the comparison value; otherwise, false. For text variables, the comparison value is case sensitive with this line condition (e.g., ‘RULE’ is less than ‘rule’ is false, but ‘rule’ is less than ‘RULE’ is true).
is greater than Returns true if the variable value is greater than the comparison value; otherwise, false. For text variables, the comparison value is case sensitive with this line condition (e.g., ‘RULE’ is greater than ‘rule’ is true, but ‘rule’ is greater than ‘RULE’ is false).
is less than or equal to Returns true if the variable value is less than or equal to the comparison value; otherwise, false. For text variables, the comparison value is case sensitive with this line condition.
is greater than or equal to Returns true if the variable value is greater than or equal to the comparison value; otherwise, false. For text variables, the comparison value is case sensitive with this line condition.
contains Returns true if the text variable value contains the comparison value; otherwise, false. For text variables, the comparison value is case sensitive with this line condition. For numeric variables, this line condition does not apply.
is not blank Returns true if the text variable value is not blank or the numeric variable value is not zero; otherwise, false.
is blank Returns true if the text variable value is blank or the numeric variable value is zero; otherwise, false.
is in filter Returns true if the variable value matches the Business Central filter criteria specified by the comparison value; otherwise, false.
is not in filter Returns true if the variable value does not match the Business Central filter criteria specified by the comparison value; otherwise, false.

Action Lines

Action lines are set for when the condition result is true or false. Action lines reference the definition line and can be set on the group or variable. When actions are set on the group, the condition result is based on the condition results for all variables and nested groups inside it. When actions are set on the variable, the condition result is based only on the variable. In both cases, the actions for the definition line execute based on its condition result.

If actions are specified for a group definition line, they execute based on the group condition result. See the Group Type table from above for information on when group condition results evaluate to true or false.

If actions are specified for a variable definition line, they execute based on the variable condition result.

Complete the following to set the action lines in the Rule Definition Builder page:

  1. Select the definition line where the actions apply and will execute based on its condition result.
  2. Add the actions to execute when the condition result for the definition line is true in the When Condition is True section.
  3. Add the actions to execute when the condition result for the definition line is false in the When Condition is False section.
  4. Initiate the action line for the condition result.
  5. Set the Rule Action to the action type to execute (see the table below for available actions).
  6. Set the Execution Order for the action to execute relative to the other actions for the condition result.
  7. Set the Variable Name to the configuration option choice or quantity affected by the action (if applicable).
  8. Set the Value to the parameter required by the action line (if applicable; see the table below on how Value is handled).
  9. Set the Target Rule ID to another rule to execute (if applicable).

The Rule Action can be one of the following:

Action Type Description
Continue Processing Action ignores the condition result, and no action is executed.
Error Action displays an error message with text specified by the rule action value.
Hide Choice Action hides the option choice as specified by the rule action variable name and value in the BOM Designer choice code lookup.
Hide Option Action hides the option as specified by the rule action variable name and value in the BOM Designer.
Message Action displays a message with text specified by the rule action value.
Run Rule Action executes another rule as specified by the rule action target rule ID.
Set Value Action sets the value for the rule action variable name with the specified value.
Show Choice Action shows the option choice as specified by the rule action variable name and value in the BOM Designer choice code lookup.
Show Option Action shows the option as specified by the rule action variable name and value in the BOM Designer.
Was this article helpful?
4.5 out Of 5 Stars

1 rating

5 Stars 0%
4 Stars 100%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Go to Top