K2

K2 SmartForms Rule Interaction

K2 SmartForms Rule Interaction

When working with any K2 SmartForm project, you sometimes find that pieces of functionality mimic another or call the same procedures.

In K2 you can’t physically copy and paste rules, but you can execute one rule from within another rule.

This is really convenient when you have to execute the exact same set of conditions / functions from multiple control interactions, and it also makes later changes a lot simpler since the change needs to be done in only one place. When you need something extra to be done that the “base rule” doesn’t take care of you can just piggy-back it before or after the referenced rule as needed.

In this example we have a form with different views. The actions from controls on both views populate the K2 ListView. When the “All Items” checkbox is changed we will execute the base rule (in this case the Change UW Drop-down List rule).

1 - K2 SmartForms Rule Interaction - Form Layout

1 – K2 SmartForms Rule Interaction – Form Layout

To execute another rule, you simply navigate to the “Actions” tab and scroll to the “Rule Interactions” tab. There you can select to either continue rule execution, stop rule execution or execute another rule.

2 - K2 SmartForms Rule Interaction

2 – K2 SmartForms Rule Interaction

You can set up your own conditions and/or actions before and/or after the rule interaction.

3 - K2 SmartForms Rule Interaction

3 – K2 SmartForms Rule Interaction

When you configure the rule interaction you gain access to all the rules set up on the current form including those from all the views on that form.

4 - K2 SmartForms Rule Interaction

4 – K2 SmartForms Rule Interaction

5 - K2 SmartForms Rule Interaction

5 – K2 SmartForms Rule Interaction

Your control will now execute both the actions you manually added as well as all rules from the rule you chose in the rule interaction configuration (“base rule”).

6 - K2 SmartForms Rule Interaction - Base Rule

6 – K2 SmartForms Rule Interaction – Base Rule

This approach can also be very useful when specific form rules need to be executed on the closing event of a subview (i.e to refresh a grid to show updated changes made in subview).

More about successful K2 SmartForms Projects

Great technology is made even better when it is applied correctly.  Velocity IT has been providing K2 customers with experience and expertise they need to be successful.  Read more…

You may also like

Leave a comment

PODCAST  |  Why you need to establish a K2 Center of Excellence today

Interview with Arno van Rooyen, CEO, Velocity