K2BTools Tutorial - Exercise 5.1: In-Grid Actions

In this exercise you will learn how to add actions to a WorkWith or SubWorkWith node, inside the grid contained in them.

The sample KB includes a procedure called “ChangeCustomerState”, which receives a CustomerId as a parameter. In this exercise, you will add an action in the Customer “WorkWith” to call that procedure.

  1. Open the Customer transaction and go to the K2BEntityServices pattern definition.
  2. Find the “WorkWith” node, and add an “Actions” node.
  3. Inside the “Actions” node, add an “Action” node. Set these properties:
    1. “Control Name (Id)” to “ChangeCustomerState”
    2. “GXObject” to “ChangeCustomerState” (this procedure shold already exist in the KB).
    3. “Position” to “InGrid”.
    4. “Image” to “K2BActionTrnNewLine”.
      Tutorial_51_PropertyDefinition
      Action properties

  4. Pass “CustomerId” as a parameter. To do so, follow these steps:
    1. Add an “Arguments” node.
    2. Add an “Argument” node.
    3. Set the “Value” property in the Argument node to “CustomerId”.
  5. Save, generate, and execute your app. Test the action in the Customer Work With.