When sending data from a K2 SmartForm view on one form to a ViewMethod on another form, you can either send the data across in a query string and execute the ViewMethod once the new form initializes, or you can do it all with one rule while at the same time removing the need for a query string.
First we have an event that kicks off the process. When this button is clicked it takes data from the current view and uses it as input parameters for a ViewMethod of a different View on a different Form.
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.
In the event configuration you only need one action to execute the scenario detailed above. This action can be found on the Actions tab under Navigation.
Specify the form, view and ViewMethod.
There are 3 stages of configuration, on the first stage you can specify parameters that will be sent through in a query string format. We don’t have any parameters and as you can see the URL preview is clean.
On the second stage we have access to all the controls, SmartObjects, parameters and expressions from the current K2 SmartForm form and views. Drag the desired objects into the input properties section of the ViewMethod from the view on the new form we will be avigating to.
On the third stage you have access to the K2 SmartForms form we will be navigating to as well as it’s views, parameters and SmartObjects. We transfer the return parameter from the executed ViewMethod to the K2 SmartForms form parameter.
On the form initialized event of the new form we execute our read method, to obtain data from the new request created when we navigated to the new form.
The read message uses the newly transferred form parameter as input.