To easily reschedule a Workflow run, the following Helper Functions can be used. They automatically close the Workflow run as soon as they have successfully submitted the reschedule, and the reschedule will be resumed from the same Page that it was triggered from.
All of the functions feature an optional "callback" function that can be included to execute further code when the function has either successfully completed or failed. These won't be specifically mentioned in each function, but are always the final parameter.
How To
There are three functions allowing specific classes of reschedule (To All, To Group, and To User), as well as a generic reschedule function allowing customised behaviour depending on the passed parameters.
Name
|
Description
|
Code
|
Script.RescheduleToAll
|
Reschedules the current Workflow run to all Users, being accessible through the outstanding record list in the Campaign view when it becomes due.
The first parameter is a string of the outcome.
The second parameter is the date and time that the reschedule will become due. Can either be provided as a JavaScript Date object, or a string in the form "YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm", or "YYYY-MM-DD".
|
Reschedule to all agents immediately.
Script.RescheduleToAll(
,
,
);
|
Script.RescheduleToGroup
|
Reschedules the current Workflow run to all Users in a specified Group, being accessible through the outstanding record list in the Campaign view and the outstanding tasks list when it becomes due.
The first parameter is a string of the outcome.
The second parameter is the date and time that the reschedule will become due. Can either be provided as a JavaScript Date object, or a string in the form "YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm", or "YYYY-MM-DD".
The third parameter is the ID of the Group for the record to be rescheduled to.
|
Reschedule to the specified Group immediately.
Script.RescheduleToGroup(
,
,
,
);
|
Script.RescheduleToUser
|
Reschedules the current Workflow run to a specific User, being accessible through the outstanding record list in the Campaign view and the outstanding tasks list when it becomes due.
The first parameter is a string of the outcome.
The second parameter is the date and time that the reschedule will become due. Can either be provided as a JavaScript Date object, or a string in the form "YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm", or "YYYY-MM-DD".
The third parameter is the ID of the User for the record to be rescheduled to.
|
Reschedule to the specified User in 24 hours time.
Script.RescheduleToUser(
,
,
,
);
|
Script.Reschedule
|
Accepts a single JavaScript object as a parameter, with that object containing any keys and values that you want to use to specify the reschedule. Note that if both a userid and groupid are specified, then the groupid will be ignored.
outcome: A string of the outcome for the current Workflow run, to be used upon its closure.
datetime: The date and time that the reschedule will become due. Can either be provided as a JavaScript Date object, or a string in the form "YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm", or "YYYY-MM-DD".
userid: A string or integer of the ID of the User to be rescheduled to. If rescheduling to All Users or a specific Group, this should equal 0.
groupid: A string or integer of the ID of the Group to be rescheduled to. If rescheduling to All Users or a specific User, this should equal 0.
callback (Optional): The optional callback function.
|
Reschedules to the current agent in 15 minutes.
Script.Reschedule({
outcome:,
datetime:,
userid:,
groupid:,
callback:
});
|
Notes
The callback response consists of a JavaScript object with the following structure:
{
Success: true,
Error: "",
ErrorMessage: "",
Id: "200"
}
|
|