Queue a Script to launch at the end of a script run

Name
Change Description
Version Number
New feature
New feature
Version 4.5.36+
 
The Queue Scripts code allows an additional script or scripts to be queued after the current script is completed (effectively queuing multiple activities).  For example, a survey script could be queued based on the customer completing an order page, or an agent break script triggered once a sale has been completed.  The Queue Script feature is used to link scripts by:
 
  •  Campaign Name (outbound to outbound)
  •  DDI linked to a Campaign (inbound to outbound)
  •  DDI/CLI (inbound to inbound)
 
Depending on how the system is configured the Activity button will contain the existing and new script names, allowing the agent to navigate backwards and forwards between the old and new script, and view data from each as necessary:
 
 
The code listed below should be placed in  JavaScript or JavaScript - Button controls, and not using a Calculate control (which continues to fire the code  and will queue up multiple scripts).
 
There is no visibility of the actual script queue in the Agent Desktop, and there is no return value using the Queue object code.
 
 

Example

In this example an inbound script is opened, and data is passed from the current to the destination script using variables:
Script.Queue.QueueInboundCall(true, '123456',[var_CLI],
{
var_variableInDestinationScript:[var_variableInCurrentScript]
});
 
 
Or if a control name was being used, the code would look like this:
Script.Queue.QueueInboundCall(true, '123456',[var_CLI],
{
CustomerName:[CustomerName]
});
 
 

Code breakdown:

 
Script.Queue.QueueInboundCall
Compulsory
 
Script queue
code
 
true/false
Compulsory
 
Consider if the user needs to see the old and new script in the Activity button in the Agent Desktop?
 
True:
 
False:
 
 
123456
Compulsory: Set up in the DDI Admin module
 
The DDI linking to the new script.  The DDI provides the link between the current and new script.
 
[var_anyvariable]
[anycontrol] or
'hardcoded'
Compulsory
 
Usually populated by var_cli, but can be used for any data.  Must have variable/control or hardcoded option added otherwise code will not function.
 
var_VariableInDestinationScript
Optional: This is the container
 
The variable, control or hard coded data to pass through into the destination script.  This name will store the data set in the actual variable or control (see next column)
 
var_variableInCurrentScript
Optional: This is the value
 
The variable/control/hard coding value in the current script