|Bookshelf Home | Contents | Index | PDF|
Keep these differences in mind when you read the syntax diagrams. In many instances, the only difference between the VB syntax and the eScript syntax is that the eScript syntax requires the pair of parentheses at the end. In these instances, only the VB syntax is shown; you can derive the eScript syntax by adding the parentheses.
There are also some important differences between Siebel eScript and standard ECMAscript. Most important, Siebel eScript has no user interface functions. It cannot, therefore, be used to animate or control Web pages. Second, it contains two objects that are not part of standard ECMAscript: SELib and Clib. These objects implement a variety of C-like functions for interacting with the operating and file systems, and for file I/O. For details on these and other eScript functions not covered here, read Siebel eScript Language Reference.
Declare your variables. Standard ECMAscript does not require that you declare variables. Variables are declared implicitly as soon as they are used. As a general rule, you should declare the variables used in a module before you use them. Doing so makes it easier for others to understand your code, and for you to debug the code.
Use the this object reference. The special object reference this is eScript shorthand for "the current object." You should use it in place of references to active business objects and components. For example, in a business component event handler, you should use this in place of ActiveBusComp, as shown in the following example:
var oBusComp = oBusObject.GetBusComp("Opportunity");
var oBusObject = TheApplication().GetBusObject("Opportunity");
Make effective use of the Switch construct. Use the Switch construct to choose among any number of alternatives you require, based on the value of a single variable. This is greatly preferable to a series of nested If statements because it simplifies code maintenance. It also improves performance because the variable must be evaluated only once.
Destroy any objects you have created when you no longer need them. While the interpreter takes care of object cleanup, it is a best practice to write code that explicitly destroys objects when they are no longer used. Explicit destruction of Siebel objects should occur in the procedure in which they are created.
|Siebel Object Interfaces Reference|