new ScriptJob()
Represents a script job
Extends
Methods
(static) cancelSchedule(name)
Cancel a job schedule
Name | Type | Description |
---|---|---|
name | string | The schedule name |
- Version
- Experimental feature, might be removed at any time
- Since
- 5.5.0
(static) schedule(name, interval, user, scriptName, functionNameopt, runInTransactionopt)
Add a job schedule
Name | Type | Attributes | Description |
---|---|---|---|
name | string | The schedule name | |
interval | number | The interval in minutes | |
user | nil | The user | |
scriptName | string | The script name | |
functionName | string | <optional> | The function name |
runInTransaction | boolean | <optional> | Boolean |
- Version
- Experimental feature, might be removed at any time
- Since
- 5.5.0
insert()
Add the job to the job queue
- Overrides
setFailureFunctionName(functionName)
Set the name of the function to call when the script job fails.
Name | Type | Description |
---|---|---|
functionName | string | Name of the function to call |
- Since
- 5.3.3
setFunctionName(functionName)
Set the name of the function to call. The script will be run as global script if no function name is set.
Name | Type | Description |
---|---|---|
functionName | string | Name of the function to call |
setParameters(parameters)
Sets the parameters passed to the script. If a function is specified, then the parameters are passed as the first argument. If no function is specified, then the variables will be added to the global context
Name | Type | Description |
---|---|---|
parameters | object | Parameters object |
setPriority(priorityNumber)
Sets the priority of the job. Default priority is 100. The lower the number the higher the priority.
Name | Type | Description |
---|---|---|
priorityNumber | integer | Priority |
- Inherited From
setRunInTransaction(runInTransaction)
Set to true if the entire script job should be run in a transaction. If false, then the script must handle transactions.
Name | Type | Description |
---|---|---|
runInTransaction | boolean |
- Since
- 5.3.3
setScript(scriptID)
Set the script
Name | Type | Description |
---|---|---|
scriptID | string | Registered ID of the script |
setUser(User)
Set the user. If not set, the current user will be set on insert(). Note: setting a different user is allowed only if elevatedDo() is allowed in this context, otherwise an access denied exception is thrown
Name | Type | Description |
---|---|---|
User |