eScript General Guidelines
In this part we will learn some general guidelines and concepts about Siebel scripting.
Note the following pointers:
- Variable declaration required unlike Java Script
- Scripting is case sensitive
- User four-digit years in dates to avoid Y2K problem and Siebel format is MM/DD/YYYY
- The "this" object reference is used to refer to the active business object and components. Example
function BusComp_PreQuery ()
{
this.ActivateField("Account");
this.ActivateField("Account Location");
this.ClearToQuery();
this.SetSortSpec( "Account(DESCENDING)," +
"Account Location(DESCENDING)");
this.ExecuteQuery();
return (ContinueOperation);
}
- Characters such as the double quote mark ("), the single quote mark (’), the hard return, the semicolon(;), and the ampersand (&) have special meanings within JavaScript and eScript. Use Siebel escape (backslash(\) character) to avoid special meaning in the code
- Single line comments are indicated using two forward slashes "//"
- Block comments are indicated with the beginning of slash and asterisk "/*" and end with asterisk and slash "*/" Block statements should not be nested.
- Put semi colons at the end of each statement to increase readability.
- Variable declaration can be either local or global. For local declare within the function whereas in global variables declared in general declaration section.
- Following are the Pre-defined Identifiers which have special meaning to Siebel Interpreter and should not be used as variable or function names.
break export super
case extends switch
catch false this
class finally throw
const for true
continue function try
debugger if typeof
default import while
delete in with
do new var
else null void
enum return
Next we will see Siebel Operators.