Introduction

The latest How To topics are available in the K2 Five User Guide or the K2 Cloud User Guide’s How to section.

Changes have been made to these Actions to allow for navigation to a different Form, set a Form State and specify either the parameters or the State using static values or dynamically use Data Fields to set the value which will then be resolved at runtime.  This Knowledge Base article describes how to use this new feature.

Implementation Details

In the Rule Action to "navigate to a Form", new options have been added to the configuration. After adding the Rule Action, click on (configure) to set the state or parameters.

Image


Note how the parameter is added to the query string and DepartmentID field is indicated in the string. Dynamic values can be used by dragging values from the Context Browser and dropping them into the relevant fields. You can also select an existing state from the drop down menu, or use a dynamic value.

Image

This functionality is also available for the Rule Actions to navigate to a Form and go to a View or Tab.

Example Scenario
In the scenario we have a Form that contains a list of departments. Once a department is selected by double clicking on the department, it should navigate to another Form which will list all employees that are in that specific department. We will use different methods of opening the new Form and apply a parameter and different states of the Form.

Follow the steps below to set up the scenario as described above.

Example 1

  1. Create the following SmartObjects:
    Image
    Image
  2. Create an association between the SmartObjects as shown below.
    Image
  3. Create an Item View, List View, Editable List View and Form on both SmartObjects.
  4. Edit the Department Form and create a Tab called Department List. Drag the Department List View from the first tab to the Department List tab created.
    Image
  5. Do the same for the Employees Form.
    Image
  6. Click on the Parameters step and create the DepartmentID parameter. Click Finish to save the Form.
    Image
  7. Edit the Department Form and add the following Rule.
    Image
  8. Click on configure next to the Action and configure the navigation as shown below. Note how the parameter is added to the query string and DepartmentID field is indicated in the string. Click OK and Finish to save the Rule.
    Image
  9. Click Finish to Save the Form.
  10. Edit the Employees Form and edit the When the Employees List executed Initialized Rule.
  11. Disable the current Get List Action and add the Get List rule definition item as shown below.
    Image
  12. Click on configure next to the Action and drag the DepartmentID parameter into the Department Input Property field. Click Finish and Finish again to save the Rule.
    Image
  13. Click Finish to save the Form.
  14. Run the Department Form and create some data by capturing data in Name field of the Department Item View and click Create.
    Image
  15. Run the Employees Form and create some data by capturing data in the Name field of the Department Item View and click Create.
    Image
  16. Run the Department Form, click on the Department List tab and double click an item such as HR in this example.
    Image
  17. A new window opens and displays the Employees Form. Click on the Employees List tab to see all the employees that are in HR.
    Image

Example 2

Use the same scenario as above to create the following example.

  1. Edit the Department Form and go to the Rules step of the wizard.
  2. Edit the Rule When Department List executed List item double click.
  3. Delete the Action that we added in the previous example and add the following Action.
    Image
  4. Click on configure next to the Action and select Current window/frame as shown below.
    Image
  5. Click OK, then Finish and Finish again to save the Form.
  6. Run the Department Form, click on the Department List tab and double click an item such as HR.
    Image
  7. The Employees Form opens in the current frame and navigates to the Employee List. Note the current frame is still Department, and the Employees List is opened within that frame.
    Image

Example 3

Use the same scenario as above to create the following example.

  1. Edit the Employees Form and go to the Rules step of the wizard.
  2. Add a new state called Employee state.
    Image
  3. Select the new state and edit the Rule When the Form is Initialized.
  4. Add the following Action. Select the Employees tab to be hidden when the Employee state is used.
    Image
  5. Click Finish and Finish again to save the Form.
  6. Edit the Department Form and go to the Rules step of the wizard.
  7. Edit the Rule When Department List executed List item double click.
  8. Delete the Action that we added in the previous example and add the following Action.
    Image
  9. Click on configure next to the Action and select the Employee state as configured earlier and Current window/frame as shown below.
    Image
  10. Click OK, then Finish and Finish again to save the Form.
  11. Run the Department Form, click on the Department List tab and double click an item such as HR.
  12. The Employees List tab opens in the current frame. The Employee state is correctly applied as the Employees tab is hidden.
    Image