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 “ChangeCustomerStatus”, 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 “ChangeCustomerStatus”
    2. “GXObject” to “ChangeCustomerStatus” (this procedure should already exist in the KB).
    3. “Position” to “InGrid”.
    4. “Image” to “K2BActionAdd”.
      Tutorial_51_PropertyDefinition2
      Action properties

  4. Use “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.

Note: If you are not able to see the action, press CTRL + F5.