Setting up stored procedures

TaskMan can execute stored procedures directly, without going through the IDO layer. To do this,TaskMan bundles the stored procedure in a transaction.

This example shows the steps to set up a stored procedure that runs through TaskMan from a form:

  1. Open the Background Task Definition form.
  2. Specify this information:
    Task Name
    Specify AddProcessErrorLogSp.
    Task Description
    Optionally, specify a task description.
    Executable Type
    Select SP.
  3. Click Save.
  4. Close the Background Task Definition form.
  5. Open your form in Design Mode.
  6. Add a Button component.
  7. In the Component > Properties tab, specify this information:
    Name
    Specify TestSP.
    Caption
    Specify sTest.
  8. Create an event for the TestSP button:
    1. In the Component > Events > Primary field, click the ellipses () button.
    2. In the Event Handlers dialog box, click New.
    3. In the Event Handler Properties dialog box, specify this information:
      Event
      Specify RunSP.
      Description
      Optionally, specify the event description.
      Type
      Select Run Background Task.
    4. In the Parameters field, click the ellipses () button.
    5. In the Event Handler Parameters dialog box, specify this information:
      Error Message
      Specify mBackendMessage.
      Success Message
      Specify sSubmitted.
    6. Click Type Specific Parameters.
    7. In the Edit Background Task Name and Parms dialog box, specify this information:
      Task Name
      Specify AddProcessErrorLogSp.
      Task Parms
      Specify BG~TASKID~,FV(TestMessage).
      Note: The FV keyword tells the application to enclose the value of TestMessage in single quotes. The BG~TASKID~ substitution keyword is replaced at run time with the task number.
    8. Click OK.
    9. Verify that RunSP is the primary event for the TestSP button.
  9. Save the form.
  10. Add an Edit component with a variable called TestMessage as the data source.
  11. Save the form.
  12. Exit Design Mode.
  13. Specify a message in the TestMessage edit box and then submit the task.
    The system displays a message box that says: Submitted.
  14. Open the Background Task History form.
    When the task completes, the test message shows up in the event log.