AX2387
RunEvent function
Runs any Scheduler jobs that contain the specified event. The jobs are added to the schedule and are eligible to be processed immediately, depending on Scheduler thread availability and any other higher-priority jobs already in the queue. The processing priority for the jobs is Event Handler.
To run the jobs, the user double-clicks on the cell containing the RunEvent function. Variable values can be passed to the job using the function.
Syntax
RunEvent("DisplayName", "EventName", "PreConfirmationMessage", "PostConfirmationMessage", "VariableValuePair1", "VariableValuePair2", [Additional VariableValue pairs])
Parameter | Description |
---|---|
DisplayName |
The display text for the cell containing the RunEvent function. For example, the text could be something like "Click here to process plan files." The DisplayName displays as normal text in the cell. If you want the text to appear like a hyperlink on a web page, you must manually apply the font formatting to the cell. |
EventName |
The name of the event handler that you want to run. Any Scheduler jobs that contain an active event handler with this name will be run. |
PreConfirmationMessage |
Optional. A custom message to display to the user before the jobs are added to the schedule. The user has the option to continue the operation, or cancel. If no custom message is defined, then the following generic confirmation is displayed: "You are about to run the event EventName. Do you wish to continue?" If the user clicks Yes, the jobs are added to the schedule. If the user clicks No, the process is canceled and no action occurs. |
PostConfirmationMessage |
Optional. A custom message to display to the user after the jobs have been added to the schedule. This is for information purposes only; the only action the user can take is to dismiss the dialog. If no custom message is defined, then the following generic confirmation message is displayed: "Event EventName has been scheduled." NOTE: If no jobs contain an active event handler with the specified name, then the message "No jobs found for event EventName" is displayed. This message is displayed regardless of whether a custom message is defined. |
VariableValuePairs |
The function arguments can contain one or more variable/value pairs, up to 10 pairs. Each pair must be listed using the format "VariableName=Value" (with or without spaces around the equals sign). If the specified name matches a job variable used in the job, then that variable will be replaced with the specified value. If no matching variable is found in the job, then the variable/value pair is ignored. |
Remarks
- The user who double-clicks the RunEvent cell to trigger the job execution does not need to have security permissions for Scheduler, or to any of the jobs that contain the specified event handler. If the event handler is configured to run as Requester (instead of Owner), then the user must have the appropriate rights to any files to be processed by the job.
- The Axiom Double-Click setting does not need to be enabled for the sheet in order to use RunEvent.
- RunEvent is a volatile function.
Examples
RunEvent("Click here to process plan files","ProcessPlanFiles")
This example executes any job that contains an event handler named ProcessPlanFiles.
RunEvent("Click here to process plan files","ProcessPlanFiles",,,"filter = region='north'")
This example executes any job that contains an event handler named ProcessPlanFiles. If the job uses a variable named {filter} to define the list of plan files to process, then the specified filter will be passed to the job, and only departments belonging to the North region will be processed.
RunEvent("Click here to process plan files","ProcessPlanFiles","You are about to process plan files for the "&C3&" region. Do you want to continue?",,"filter = "&C4)
This example is the same as the previous example, except that a custom pre-execution message is being displayed to the user. Additionally, cell references are used so that the message and the filter are dynamic, depending on what region is being processed.