Confirmation messages in K2 SmartForms are very intuitive to use straight out of the box, but K2 also gives you the power to modify them to your own specific needs.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
Using the out-of-the box confirmation found in the “conditions” section of the rules allows you to only specify a header and body for the message. K2 then continues rule execution if the user selects “ok” and stops rule execution if the user selects “cancel”.
In some browsers this functionality doesn’t always work 100% and in very limited cases the rule execution continues even after the user selected “cancel”.
The solution to this is very simple and it also demonstrates the more flexible approach to confirmation messages. When you place the confirmation message inside an if/else statement, the rule will execute normally when the user selects “ok”, but if the user selects “cancel” rule execution will continue in the else block of the if statement.
This is very useful not only in cases where the out-of-the-box confirmation box fails to stop rule execution on cancel, but also if you would like to add additional rules when the user does cancel instead of just stopping the rule execution completely.
K2 also provides you an option to completely customize your confirmation message. For example if you wanted to add specific K2 SmartObject data or K2 Expressions to the message body.
To accomplish this you simply add a “show message to the user” action.
In the rule configuration you select message type as confirmation and your message will now function exactly like the original K2 Confirmation Message. You can also use your custom confirmation message with the different approaches described above.