Configuring Siebel Business Applications > Configuring a Siebel Application > Using Development Tools >

Creating a Script to Configure Siebel CRM


This topic describes how you can use Siebel Visual Basic, Siebel eScript, and browser script to write scripts that configure Siebel CRM. It includes the following topics:

A script is associated with an 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.
  • Siebel eScript. Compatible with JavaScript. It supports scripting in Windows and other operating systems, such as UNIX.

You can use Siebel Visual Basic and Siebel eScript to do the following work:

  • Integrate Siebel CRM with a third-party application.
  • Configure the base functionality of the screens and business components in Siebel CRM.
  • Develop a data validation routine to enforce rules before or after Siebel CRM manipulates records. Siebel CRM does validation routines before the user updates or inserts a record. This configuration makes sure that the user 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 that opens an external application on the Siebel Server in reply to a Siebel event or to send 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. 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
  • Application

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.
  • JavaScript, see JavaScript Usage in High Interactivity.
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

Browser script allows you to use JavaScript, which is an interpreted language that runs in many Web browsers. A browser script responds to an event on a browser Java object. This browser object works with the corresponding object that runs in the object manager. The set of events that you can script with a Browser object type is different from the set of events that you can script with a server script:

  • For Siebel CRM, you can script a wide variety of events that the browser supports. 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:

  • Applet
  • Business Component
  • Business Service
  • Application
Hierarchy of Object Types That Siebel CRM Uses With a Script

Figure 35 describes the hierarchy of relationships between object types that Siebel CRM can use with a script. To script a browser event, you use a child object type of the parent. You can use these object types with their server counterparts in Siebel Visual Basic, JavaScript, or Java.

Figure 35. Hierarchy of Relationships Between Object Types That Siebel CRM Uses with a Script

Figure 36 includes 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. This 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:

  • Applet
  • Business component
  • Business service
  • Application

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 that handles 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 appropriate only if Siebel CRM displays the Siebel object that the script references in the Siebel client. For more information, see High Interactivity.

Creating and Deploying a Browser Script

You can create and deploy a JavaScript file (.js).

To create and deploy a browser script

  1. Use one of the following configurations to create the browser script:
    • In Siebel Tools, compile objects to a repository file.

      If you compile objects to a repository file, then Siebel Tools only creates 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:

    ORACLE_HOME\public\language_code\srf_timestamp\bscripts\all

    where:

    • ORACLE_HOME is the root directly of where you installed Siebel Tools.
    • language_code is the language code, such as ENU.
    • srf_timestamp is the timestamp when the Siebel Repository File (SRF) is saved.

      For more information, see Using Siebel Tools.

    • In the command line interface, run the genbscript.exe utility.

      If you run the genbscript.exe utility, then it creates all browser scripts that exist in the Siebel repository and places them in a directory that you define. You run this utility from the ORACLE_HOME/bin directory.

      Use the following format to run genbscript:

    genbscript config_file destination_directory language_code

    where:

    • 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.

      For example:

    genbscript c:\siebel\client\bin\enu\uagent.cfg c:\siebel\client\public\enu enu

  2. Stop, and then restart the Web server.

    This configuration loads the scripts into SWSE and avoids an Object Not Found error message. For more information, see Updating Web Images to Load Scripts into SWSE.

  3. Deploy the browser script to the following directory on the Siebel Server:

    ORACLE_HOME\webmaster

  4. Deploy the browser script to the following directory on the Siebel client:

    ORACLE_HOME\public\language_code

  5. If you migrate scripts from one location to another location, then you must copy the following directories to the correct location:

    \\srfTimestamp\bscripts\all\

    If you create 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:

    c:\ORACLE_HOME\webmaster\srfTimestamp\bscripts\all\

  6. 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

  1. Log in to Siebel CRM.

    For example, type the following URL into the Address field of the browser:

    http://user_name.siebel.com/callcenter

  2. Type the following URL into the Address field of the browser:

    http://user_name.siebel.com/callcenter/start.swe?SWECmd=UpdateWebImages&SWEPassword=password

    where:

    • 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.
Configuring Siebel Business Applications Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.