Triggers

Triggers allow you to perform an action, or actions, when an event occurs on an attribute. This is very useful for situations when you may want to reset an attribute when another attribute is selected or has changed selections.
For example, there is an attribute called Unit of Measure that determines what length is going to be entered in another attribute, Length. Unit of Measure includes the values Inches and Centimeters. If a user selects Inches, types in 12 in the Length attribute, but then decides to change Unit of Measure to Centimeters, then we would want to reset Length so that the user knows to enter a centimeter measurement instead of an inches measurement. This is a good example where triggers can come into play to affect other attributes based on its own event.
Triggers are defined for each individual attribute. To define a trigger, go to the Product Attributes page of the desired Product. Click the Trigger button in the attribute’s setting box of the desired attribute,. This opens the Trigger panel where actions can be defined for each trigger circumstance as shown in Figure A. All that needs to be defined here is the action that will occur under each event: Change, Select, and Reset.

Figure A - Triggers

The three Trigger types are:

  1. Change Trigger – activates when the user changes the previously selected value within the attribute.
    • Example: <*ResetAtt(Length)*> - Placed in the Unit of Measure attribute, this will reset the attribute Length when the selection has been changed for the attribute Unit of Measure.
  2. Select Trigger – activates when the user selects any value from the attribute without a previous selection.
    • Example: <*ResetAtt(Length)*> - Placed in the Unit of Measure attribute, this will reset the attribute Length when the selection has been changed for the attribute Unit of Measure.
  3. Reset Trigger – activates when the user deselects a previously selected value within the attribute.
    • Example: From our example above, Length’s Reset trigger would be run after Unit of Measure’s Change or Select <note>Change Trigger is not activated by attribute's first selection (Select Trigger is activated), and is not activated by attribute's de-selection (Reset Trigger is activated). Change Trigger activates when there is only a full change, which is a new Value selection resets previously selected value.</note>


It is also possible to have multiple Triggers together in the same attribute and multiple actions in each trigger (separated by a semicolon). There can also be conditional expressions used within each trigger to determine whether or not an action tag should be run. Triggers can be entered manually, or by using the Code Builder which is described in the chapter on Code Builder. To invoke Code Builder for a trigger, click on the “V” button positioned near the lower left corner of the appropriate trigger. In the Code Builder window, the Actions box under Triggers/Rules will only contain actions appropriate for Triggers. Conditional Tags that return a TRUE or FALSE, such as the ANYSEL tag, will not be available for Trigger expression building in the Code Builder, but they can be used.

Clicking Next or clicking another Attribute name in the left column on the Product Attributes page will save a Trigger and any other information changed for that Attribute.

Triggers run before Attribute Dependencies and Rules in the system’s processing order. See the section The Order of Things in the Rules section for more information.

You are here: CallidusCloud SAP CPQ Online HelpAdmin Page HelpProduct AdministrationProductsTriggers