Configuring Siebel Business Applications > Configuring a Siebel Application > Using Development Tools and Techniques >
Creating a Script to Customize Siebel CRM
This topic describes how you can use Siebel Visual Basic, Siebel eScript, and browser script to write scripts to customize Siebel CRM. It includes the following topics:
A script is associated with a specific object and event in the Siebel Event Model.
Scripts That You Write for the Server
Siebel Tools includes the following scripting languages:
- Siebel Visual Basic. Similar to Microsoft Visual Basic. It supports scripting only on the Windows operating system.
You can use Siebel Visual Basic and Siebel eScript to do the following:
- Integrate Siebel CRM with a third-party application.
- Customize the base functionality of the screens and business components in Siebel CRM.
- Develop a data validation routine to enforce specific rules before or after Siebel CRM manipulates records. Siebel CRM performs validation routines before the user performs an update or an insert. The intent is to make sure that Siebel CRM does not enter data into the database that is not logical or is not complete.
- Develop a data manipulation or computational routine to modify or analyze data.
- Develop a data transport routine to import and export small volumes of data between Siebel CRM and a third-party application.
- Develop a routine to open an external application on the Siebel Server in response to a Siebel event or to pass start-up parameters. This capability is valid for browser script only.
You use the Script Editor, Debugger, and Compiler to develop and test Siebel Visual Basic script, Siebel eScript script, or browser script. Because Siebel CRM integrates this capability with the Applet Layout Editor, you can attach a script to a control that Siebel CRM displays in the Siebel client, such as a field or ActiveX control.
You can associate a server script with the following object types:
- Web applet
- Business component
- Business service
For more information about:
- Scripting, see Siebel eScript Language Reference and Siebel VB Language Reference.
- Redeploying a script written for a prior release of Siebel CRM in the Siebel client, see Siebel Database Upgrade Guide.
Simultaneous Use of Siebel Visual Basic Script and Siebel eScript
To respond to various client events, you can use Siebel Visual Basic and Siebel eScript simultaneously in the same environment but not in the same object. It is recommended that you use Siebel eScript only because it works on UNIX and Windows servers. When you initially add a script to an object, Siebel Tools prompts you to choose the scripting type.
Scripts That You Write for the Browser
- For Siebel CRM, you can script a wide variety of events that the browser supports. However, an HTML control does not support the OnClick event. For more information, see Siebel eScript Language Reference.
- For a Siebel employee application, you can only script on the OnBlur or OnFocus events.
You use Siebel Tools to write a browser script. You can associate a browser script with the following object types:
- Business component
- Business service
Hierarchy of Object Types That Siebel CRM Uses With a Script
Figure 35. Hierarchy of Relationships Between Object Types That Siebel CRM Uses with a Script
Figure 36 illustrates an example of how you can use a browser script to validate the field in a form that Siebel CRM displays in the Siebel client. The example uses browser script on the BusComp_PreSetFieldValue event handler in the Account business component.
Figure 36. Example of Browser Script to Validate a Field
Browser Scripting with Standard Interactivity
If your Siebel application uses standard interactivity, then you cannot write a browser script for the following objects:
- Business component
- Business service
You cannot write a script to handle a pre or post event with standard interactivity.
Note the following conditions for writing browser script with a control:
- You can write a script to handle a control event, such as Onclick, Onblur, or with a Text control.
- You can write a script for a predefined browser event on a control that is associated with an applet. For example, onChange, onMouseOver, onFocus, onMouseOut, or onBlur.
- You must write browser script on the onChange browser event of the control.
- you must use the native methods of the browser Document Object Model (DOM).
For more information, see Standard Interactivity.
Browser Scripting with High Interactivity
If your Siebel application is an employee application that uses high interactivity, then a browser script on a business component is only appropriate if Siebel objects that the script references are displayed in the Siebel client. For more information, see High Interactivity.
Generating and Deploying a Browser Script
To generate and deploy a browser script
- Use one of the following techniques to generate the browser script:
- In Siebel Tools, compile objects to a repository file.
When you compile objects to a repository file, then Siebel Tools only generates browser scripts for compiled objects. Siebel Tools places them in the directory that you define in the Scripting tab of the Development Tools Options dialog box. To view this dialog box, choose the View menu, and then the Options menu item.
If you do not create a directory, then Siebel Tools stores the browser script in the following directory:
- In the command line interface, run the genbscript.exe utility.
When you run the genbscript.exe utility, then the executable generates all browser scripts that exist in the Siebel repository and places them in a directory that you define. You run the genbscript.exe utility from the ORACLE_HOME
Use the following format to run genbscript:
- config_file is the name of the configuration file
- destination_directory is the destination directory where genbscript stores the script files
- language_code is the language code, such as ENU. The language code parameter is optional for ENU, but you must define it for other languages.
- Stop, and then restart the Web server.
This technique loads the scripts into SWSE, thus avoiding an Object Not Found error message. For more information, see Updating Web Images to Load Scripts into SWSE.
- Deploy the browser script to the following directory on the Siebel Server:
- Deploy the browser script to the following directory on the Siebel client:
- If you migrate scripts from one location to another, then copy the following directories to the correct location:
If you generate a browser script, then the Siebel system creates a directory path and names it according to the version of the Siebel repository file. The system appends it to the path that you create as the destination directory. For example, after you compile browser scripts to the Siebel Server, the system uses the following path on the Siebel Server to the browser script files:
- If you compile on a Siebel Server that runs in the Windows operating system, and then migrate browser scripts to a Siebel Server that runs on an Oracle Solaris or AIX operating system, then you must FTP the directories to the correct location on the Oracle Solaris or AIX computer.
Updating Web Images to Load Scripts into SWSE
You can update Web images to load scripts into SWSE.
To update Web images to load scripts into SWSE
- Log in to Siebel CRM.
For example, type the following URL into the Address field of the browser:
- Type the following URL into the Address field of the browser:
- user_name is the name of the user.
- password is the Siebel Enterprise Security Token. You define this token when you configure the SWSE logical profile. Siebel CRM stores it in encrypted form in the eapps.cfg file.