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.
- Open the Customer transaction and go to the K2BEntityServices pattern definition.
- Find the “WorkWith” node, and add an “Actions” node.
- Inside the “Actions” node, add an “Action” node. Set these properties:
- “Control Name (Id)” to “ChangeCustomerStatus”
- “GXObject” to “ChangeCustomerStatus” (this procedure should already exist in the KB).
- “Position” to “InGrid”.
- “Image” to “K2BActionAdd”.
- Use “CustomerId” as a parameter. To do so, follow these steps:
- Add an “Arguments” node.
- Add an “Argument” node.
- Set the “Value” property in the Argument node to “CustomerId”.
- 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.