K2BTools Tutorial - Exercise 3.2: Inserting elements from prompt

Sometimes when executing a prompt the user realizes that the record being searched does not exist. In those cases, it is practical to be able to insert a record without leaving the current task.

K2BPrompt supports generating that kind of interface. In this exercise we will activate that feature in the prompt we created in the last exercise.

  1. Go to the K2BPrompt instance created in the last exercise.
  2. Below the “Prompt” node, you will find the “Modes” node, as shown in this picture.
    PromptModesDefinition1
    Prompt Modes Definition

  3. Go to the “Modes” node and change the “Insert” property to “True”.
  4. Run your app, and try creating a new invoice using a customer that was not created in the database.
  5. Go to the K2BPrompt instance.
  6. Go to the" Modes" node and change the AfterInsert property to "ReturnToPrompt"
    PromptModesAfterInsert
    Prompt Modes After Insert property

  7. Run your app, and try creating a new invoice using a customer that was not created in database. See the difference between "ReturnToTransaction" and "ReturnToPrompt"

Tip: You can customize how the Insert action works, by using the “Insert Condition” and the “After Insert” properties. See Modes (Prompt) for more details.