Siebel SmartScript Administration Guide > Extending Scripts with Siebel VB and Siebel eScript >

Siebel VB and Siebel eScript


Siebel VB (Visual Basic) and Siebel eScript (a JavaScript-like scripting language that shares tools with Siebel VB) can be used with all SmartScript elements. This chapter describes the Siebel VB and Siebel eScript methods that are specific to SmartScripts. The syntax for all of these methods is the same in both Siebel VB and Siebel eScript. Most of the examples provided in this chapter are in Siebel VB; however, the methods work the same way in Siebel eScript. For more information about Siebel VB and Siebel eScript, see Siebel Tools Online Help.

NOTE:  Siebel eScript functions work in the same manner as standard JavaScript functions, and thus requires the trailing parenthesis () even when the function has no parameters.

Any function that can be performed using Siebel VB or Siebel eScript can be performed in the context of a SmartScript or a call script. In addition, SmartScripts are automatically configured with five Siebel VB and eScript procedures, which can be added to a question or script using the SmartScript Script Programs view and Question programs view. In addition, administrators can create their own custom procedures from these views. See Table 8 for a list of these procedures.

Table 8. Standard Siebel VB and Siebel eScript Events Used in SmartScripts
Name
Role
Script_Open
A post-event function called when the script is opened.
Script_Cancel
A post-event function called when the script is canceled.
Script_PreFinish
A pre-event function called when the user clicks the Finish button.
Script_Finish
A post-event function called after the script has been finished, but before data is saved, to allow any last-minute cleanup or post-processing.
Script_Save
An event function called before the normal script state has been saved to business components and the answer table and after the Script_Finish function has been run.

Each question element is configured with four such procedures. Other elements do not have Siebel VB or Siebel eScript procedures associated with them. These procedures can contain methods which can be used to further control the workflow of a script. See Table 9 for a list of these procedures.

Table 9. Standard Siebel VB and Siebel eScript Events Used in SmartScript Questions
Name
Role
Question_Enter
A post-event function called after the question has been entered and all pre-question processing is complete.
Question_PreLeave
A pre-event function called on the question before the user leaves it by jumping or proceeding (but not by Undo or Backup).
Question_Leave
A post-event function called after branching has been determined and all built-in validations have been performed.
Question_PreBranch
A pre-event function that allows the choice of answer to be replaced by the Siebel VB or Siebel eScript script.


 Siebel SmartScript Administration Guide 
 Published: 23 June 2003