Functions Data

ExecuteScheduleAsync

ExecuteScheduleAsync() works the same way as the ExecuteSchedule function, but runs in the background (asynchronously when called from third-party applications). This is useful for longer-running Schedules, as other work can continue while the Schedule executes. Once processing is complete, the resulting data is returned to the third-party application.


Syntax:

Qx.ExecuteScheduleAsync(Schedule, Show Error, Parameters, Parameter Value n, …, Param)
  • In Excel with Quintessence addin versions prior to 25.1, use: ExecuteScheduleAsync()
  • In the Quintessence Editor (Studio) using Quintessence language, use: ExecuteScheduleAsync()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.ExecuteScheduleAsync()
 See parameter descriptions

ScheduleSpecifies which Schedule to run.
Show Error
(optional)
Determines what notification is shown if the Schedule run fails. Options are:
• NoLog – When the Schedule fails, the cell function execution displays FALSE.
• NoLogErrors – When the Schedule fails, the function execution displays #VALUE.
• Errors – When the Schedule fails, the function execution displays the full log.
Parameter Value nSpecifies the value for the given parameter position.
ParamSpecifies the value for the 13th parameter.

Remarks:

  • Unless changed by an administrator, the default parameter is:
    • Show Error = “NoLog”
  • The function can only call a Schedule if the administrator has allowed it to be called from a function.
  • Regardless of the Show Error setting, once the Schedule has run—whether it succeeds or fails—the cell will display FALSE, indicating that the function is ready for the next execution.
  • This Schedule is executed when the user selects one of the following options from the Quintessence ribbon in Excel:
    • Execute Selected – Select the cell containing the formula, then choose Execute Selected from the ribbon. This will execute only the selected cell.
    • Execute Sheet – Select Execute Sheet from the ribbon to execute all ExecuteScheduleAsync() and ExecuteSchedule() instances in the current worksheet.

Examples:

> Example 1: Executing A Schedule on the Quintessence Scheduler


Assume a Schedule named User Upload has been created, which takes two parameters in this order:

  • User – Accepts the user’s name as a text parameter.
  • Data – Accepts the user’s data as an array parameter.

In an Excel workbook, the data is placed in cells as follows (row and column headers refer to Excel cell references):

ABC
1UserLinH
2DataValueDateValue
32000-01-06100
42000-01-07106

In terms of the parameters for the Schedule:

  • A1 – Name of the first parameter.
  • B1 – Value of the first parameter.
  • A2 – Name of the second parameter.
  • B2:C4 – Value of the second parameter.

If we call this function with full logging enabled (to view any errors or warnings that occur during the Schedule run), the formula would be as follows:

=Qx.ExecuteScheduleAsync("User Upload", "TRUE", "A1:A2", "B1", "B2:C4")

When this function is placed in a cell, it initially displays FALSE. The Schedule takes about 20 seconds to run. While it is running, the cell displays Calculating…. During this time, Excel remains fully usable.