Activating or Hiding Building Blocks with Rules

Your business relies on a well-defined logic to run successfully. For example, certain item configurations may be compatible only with specific materials. NetSuite CPQ Configurator helps you capture and enforce this logic using rules assigned to its building blocks, such as questions, answers, images. These rules represent the restrictions that limit the possible combinations of features and options users can choose for your configurable items. For example, you may prevent users from selecting a water-based finish for a metal desk frame because that could cause rust.

Rules are conditional statements based on combinations of questions and answers. Every time a user makes a selection or enters information in the product interface, the system verifies the conditions in the rules. When verifying the rules, the system compares the answers specified in the rules with the choices users have made on the product interface. If there's a match, the system activates the building blocks and performs the assigned task, such as displaying an image or including an additional item.

You can set up rules in the rule field of most building blocks. Some building blocks can have more than one type of rule. To write a rule, use question and answer codes and insert a forward slash to separate them. Each code is a unique, shortened version of a building block's name. When writing rules, always enter the question code first. For example, you may use A/1 as the rule of an image. In this rule, A is the question code, and 1 is the answer code. This code combination is the condition that the system verifies. For example, if users select answer 1 for question A, then the image is displayed on the product interface. If a question type doesn't have answers, write the rule by entering the question code only.

You can also use operators to combine multiple conditions in a rule. For example, you can assign the condition A/1&B/2 to the image. The ampersand represents the AND operator, and the system will only display the image if both conditions are true. If users select answer 1 for question A and answer 2 for question B, then the image is displayed on the product interface.

When writing rules, you can choose codes and operators from fields with predefined lists that include all available combinations and options. These fields are named Reference Codes and Operators. For more information about operators, see Using Rule Operators.

Some building blocks also have start and end dates. These dates affect how the system evaluates rules. If you define a start and end date or a start date only, the building block will only perform its assigned task if both the date range and the rule condition are met.

You can include additional conditions in your rules by using predefined answers, which are fixed questions and answers combinations that contain information from your account. For example, if you want to display a tab only for administrators, you can use this predefined answer in the tab rule SOLE/ROLEID[="administrator"]. For more information, see Including Additional Conditions in Rules and Actions with Predefined Answers.

NetSuite CPQ Configurator also supports additional rules named rule categories. When you assign a rule category to a building block, both the building block's rule and the category rule must be true for the building block to perform its task. For more information, see Working with Rule Categories.

Example

Suppose your business offers a desk as a configurable item. This desk is available in various shapes, such as rectangular, U-shape, and L-shape. You may have a question like "Choose the desk shape" with the code DESK_SHAPE. One of the possible answers may be "L-shape" with L as a code. If users choose an L-shaped desk on the product interface, the system will displays the image that contains DESK_SHAPE/L in the rule field.

Let's say the desk surface can also have assorted finishes, such as oak, cherry, or walnut. If users choose an L-shaped desk with an oak finish, the system displays the image with the rule DESK_SHAPE/L&TOP_FINISH/OAK. TOP_FINISH and OAK are the question and answer codes, respectively. The AND operator (ampersand character) indicates that users must choose both the L-shape and the oak finish to view that image.

Working with Rules

Depending on the building block to which a rule is assigned, NetSuite CPQ Configurator can perform one of the following tasks:

Note:

To perform the task, the answers selected by users on the product interface must match the condition in the building block rule.

  • Display an image on the product interface.

  • Display a validation message on the product interface.

  • Include an additional item (formerly called a breakout item) in the configuration and, later, in the transaction.

  • Add a price to the total price of the configurable item.

  • Add a material to the configuration and, later, to the work order.

    Note:

    Install NetSuite CPQ Manufacturing to create work orders. For more information, see Installing NetSuite CPQ SuiteApps.

  • Add a routing step to the configuration and, later, to the work order.

    Note:

    Install NetSuite CPQ Manufacturing to create work orders. For more information, see Installing NetSuite CPQ SuiteApps.

  • Run an action.

  • Enable a rule category.

  • Create an item required by the configuration.

  • Create records required by the configuration.

  • Set transaction body or line fields based on configuration data.

Special rule types are also available for questions, answers, tabs, and groups:

  • Hide rule – If the rule's condition is met, the question, answer, tab, or group is hidden from the product interface. This rule prevents users from viewing unavailable features and options for their current selection.

  • Read-only rule – If rule's condition is met, the question or answer remains visible but is dimmed on the product interface. This rule informs users that other options may become available if they make a different selection.

  • Incompatible rule – If the rule's condition is met, the answer is dimmed and marked with a small red cross. If the answer was previously selected, its label becomes red. This rule notifies users that the selected combination of options or features doesn't meet the configuration requirements.

Working with Rule Categories

NetSuite CPQ Configurator has additional rules named rule categories. Rule categories help you better organize and maintain your business logic. If you frequently use a rule, you can create a category with that rule and apply it to specific building block instances. Rule categories can also be used to group building block instances that will be activated or inactivated based on the rule of the category. You can apply rule categories to the following building blocks: images, pricing, additional items (formerly called breakout items), materials, and actions. You can also share rule categories across all available building blocks.

When you assign a rule category to a building block instance, the system automatically combines the rule of the category with the building block rule—as if you had added the rule of the category directly to the Rule field of the building block using the AND operator (ampersand character). For example, if a rule applies to multiple images, you can create a category and assign it to each image record. Those image records will inherit the rule of the category.

A building block with a category assigned will only perform its task if its rule and the rule of the category match the answers selected by users on the interface.

To create a rule category:

  1. Go to CPQ > Configurator > Product Maintenance.

  2. Edit the product you want to modify.

  3. On the Rule Categories subtab, click New CPQC Rule Category.

  4. Enter a descriptive name for the rule category.

  5. Select the rule category type.

    To apply the rule category to all eligible building blocks, select Common. Otherwise, select a specific building block from the list.

    Note:

    If you leave this field blank, the rule category can be applied to all eligible building blocks as if you'd selected Common.

  6. Provide a sequence number.

  7. In the Rule field, provide the condition that determines whether this tule category is active.

    Enter question and answer codes separated by a forward slash, for example, A/1. Use operators to combine multiple conditions, for example, A/1&B/2. For more information, see Activating or Hiding Building Blocks with Rules.

  8. Click Save.

Using Rule Operators

The following table lists the operators that you can use in rules to combine multiple conditions. In the examples, A represents the question code, and 1 is the answer code.

Operator

Description

Example

Meaning

/

Forward slash – Separates the question code from the answer code.

A/1

The answer to question A is 1.

&

Hard AND – Both conditions must be true for the entire rule to be true.

A/1&B/2

The answer to question A is 1 and the answer to question B is 2.

+

Soft AND – Works like the hard AND, but you use it with two or more answers to the same question.

A/1+2

The answers to question A are 1 and 2.

#

Hard OR – At least one condition must be true for the entire rule to be true.

A/1#B/2

The answer to question A is 1 or the answer to question B is 2.

,

Soft OR – Works like the hard OR, but you use it with two or more answers to the same question.

A/1,2

The answer to question A is 1 or 2.

()

Parentheses – Group conditions that the system evaluates together.

(A/1&B/2)#C/3

Either the answer to question A is 1 and the answer to question B is 2, or the answer to question C is 3.

[]

Square brackets – Used to verify the value of an answer when using the following operators:

  • equals to

  • greater than

  • less than

  • begins with

  • contains

  • ends with

The tilde symbol (~) identifies a range of numbers.

To evaluate the answer against a sequence of characters (letters and numbers), enclose the value in quotation marks. You can verify the value for:

  • All types of input box answers.

  • QTable date and time fields and popup lists (formerly called picklist dropboxes).

You can combine square brackets with resolve expressions, except when using the tilde symbol (~). For example, A/1[="{Q/A}"]. Always enclose the resolve expressions in double quotation marks. For more information about resolve expressions, see Obtaining Answer Data with Resolve Expressions.

A/1[="oak″]

A/1[^="o"].

A/1[*="a"].

A/1[$="k"]

A/1[=10]

A/1[>10]

A/1[<10]

A/1[>=10]

A/1[<=10]

A/1[10~20]

The value entered for question A, answer 1 is oak.

The value entered for question A, answer 1 begins with o.

The value entered for question A, answer 1 contains a.

The value entered for question A, answer 1 ends with k.

The value entered for question A, answer 1 is 10.

The value entered for question A, answer 1 is greater than 10.

The value entered for question A, answer 1 is less than 10.

The value entered for question A, answer 1 is greater than or equal to 10.

The value entered for question A, answer 1 is less than or equal to 10.

The value entered for question A, answer 1 is between 10 and 20.

X()

NOT – Used to negate a condition. If the condition is false, the rule is true.

X(A/1)

Answer 1 isn't selected for question A.

*

Wildcard – Represents one or more unknown characters at the beginning, the end, or in the middle of an answer code.

A/1*

A/*1

A/*1*

The selected answer code for question A begins with 1.

The selected answer code for question A ends with 1.

The selected answer code for question A contains 1.

%%

Unanswered question – Identifies a question where users didn't select any answers.

A/%%

No answer is selected for question A.

*/*

Any question and answer combination – The rule is always true. For example, the image is always displayed on the product interface.

If the asterisk replaces only the answer code, the rule is true if the user selects any answer to the question.

*/*

A/*

The rule is always true, regardless of the question and answer combination.

Question A is answered.

_

Underscore – Used after the answer code to specify a qTable row. The row number follows the underscore.

If the @ symbol follows the underscore, the underscore operator identifies the qTable cells in the same row. For example, you can make the content of a cell read-only based on a cell in the same row.

A/B_1

A/B_@

In the qTable A, the answer is the column B cell in row number 1.

In the qTable A, the answer is the column B cell that is in the same row.

[x;x=“”]

Identifies a sequence of characters, the number of characters in the sequence, and their position.

A/1[3;4=”BCDE”]

The code of answer 1 for question A is the four-character value of BCDE, beginning in position 3.

Related Topics

General Notices