Using K2BPrompt Pattern

Objective

In many cases it is needed to create selection user interfaces related to a transaction. These interfaces are used to see all the records for that transaction, and select one of them. This is commonly used in other transactions to complete a foreign key attribute referencing the transaction used to create the prompt interface.

K2BPromptRunTime
Generated Prompt in Run Time

These user interfaces can be easly generated using the K2BPrompt pattern. In this article we will explain how to apply the K2BPrompt pattern and call it in the transaction where the single selection interface is needed.

How it works

  1. Select the transaction for which the prompt is needed.
  2. Go to the pattern part and select the Prompt pattern.
    K2BPromptPatterninstance
    Prompt instance

  3. Instance Configuration
    1. The instance specification is almost the same as the WorkWith node in the K2BEntityServices Pattern. The attributes that will be shown in grid, filters, orders can be configured.
    2. For prompt purposes in the parameters node, input and output parameters can be added. By default it is generated with the primary key as an output parameter.
      K2BPromptParameters
      Prompt parameters

    3. For prompt purposes in the attributes inside the Grid Columns node, the "Return On Click" property can be configured, so when the user clicks this attribute the grid row is selected. By default, the "Description Attribute" is generated with the Return On Click property set to true.
      K2BPromptReturnOnClick
      Prompt return on click property

    4. There are many cases in which user may need to add a record in the prompt and select them, for this purpose the Insert standard action can be configured. For more information read Modes (Prompt)
  4. After the prompt is created, the prompt needs to be called in the transaction in which it is used as a foreign key. To do that, the prompt rule must to be added in the rules part of this transaction.
    K2BPromptAddingRule
    Adding the rule in the transaction where the prompt is needed