Reader small image

You're reading from  Oracle Siebel CRM 8 Developer's Handbook

Product typeBook
Published inApr 2011
Reading LevelIntermediate
Publisher
ISBN-139781849681865
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Alexander Hansal
Alexander Hansal
author image
Alexander Hansal

Alexander Hansal has worked as an IT professional in small, medium, and global corporations. Since 2001, Alexander works as a technical instructor and consultant for Siebel CRM and Oracle Business Intelligence in Europe. He enjoys teaching, and shares his knowledge and expertise in his classes at Oracle University and in his weblog, http://siebel-essentials.blogspot.com/
Read more about Alexander Hansal

Right arrow

Chapter 22. Extending Siebel CRM Functionality with eScript

In the previous chapters of this book, we explored many aspects of configuring Siebel CRM applications in order to adapt the system to our customer's requirements. All the different techniques discussed so far have one thing in common: they are declarative. This means that the developer creates and modifies records in the Siebel Repository and defines objects by editing their properties via the Siebel Tools user interface. At no time is it necessary to modify existing code or write code such as SQL scripts or C++ programs.

In the late nineties, when Siebel CRM was in its early versions and declarative options were limited, for example Siebel Workflow did not exist until Siebel 2000, developers often relied upon the possibility of extending the existing functionality with custom written program code.

Becoming more mature in versions 7 and 8, the preconfigured functionality of Siebel CRM is often sufficient to implement complex requirements...

Introduction to Siebel scripting


The Siebel scripting framework, internally named extension language or EL, allows custom developers to add code to application, applet, business component, and business service definitions. The following programming languages are supported:

  • eScript: By far the most popular scripting language for Siebel CRM. Siebel eScript is an implementation of the ECMA-262 standard, which is also the base of the popular JavaScript language. Siebel eScript is supported on all operating systems on which Siebel CRM can be installed.

  • SiebelVB: A derivative of Visual Basic is supported as a Siebel scripting language as well, albeit its importance and adoption by developers have declined over the last decade. VBScript is only supported on Microsoft Windows operating systems.

  • Browser JavaScript: Interpreted by the browser, code implemented in pure JavaScript allows developers to manipulate the objects in the browser's document object model (DOM). The Siebel scripting framework...

When to use Siebel scripting


Before we continue to learn how to implement scripts, it is necessary to mention that whenever we write script code in Siebel, there is a high risk that one or more of the following situations might occur:

  • Similar functionality already exists in the standard Siebel CRM application

  • Runtime errors or memory leaks negatively affect the application

  • The performance of the application degenerates

  • Maintenance and upgrade tasks become more difficult

To avoid any of the preceding things, we should try to fulfill customer requirements with administrative or declarative solutions, which the Siebel application framework provides in abundance, before we resort to scripting.

For example, we can use Siebel Audit Trail to track data changes instead of writing business component scripts, which do the same thing.

The Siebel Workflow framework, discussed in previous chapters, is used intensively by Oracle engineering to implement even the most complex requirements. Whenever additional...

Creating a custom business service


As discussed in the previous section, scripting is the last resort for developers. Because of the high risk, we should consider every move very carefully. The decision of where to place our code influences its manageability. We have learned in previous sections of this chapter that we can write script code at the Application, Applet, Business Component, or Business Service object level.

We can reach the highest level of reusability and availability, two important paradigms in modern programming, when we place our code in a business service method. This section will teach us how to implement a business service method with eScript.

Case study example: Retrieve person information with eScript

AHA employees often need to know more about the users who are associated with a record. Activities for example can be associated with one or more persons who can be internal employees or contacts. The AHA team must provide a proof of concept that information stored about...

Declaring business service methods and arguments


If we plan to make our business service available to other developers, we should declare the methods it implements and their input and output arguments. This is not a technical necessity but it facilitates the work of developers because they can select method and argument names from pick lists in the workflow process or script editors.

The following procedure describes how to declare the getPersonInfo method and its arguments:

  1. 1. Navigate to the AHA Info Service business service.

  2. 2. In the Object Explorer, expand the Business Service type and select the Business Service Method type.

  3. 3. In the Business Service Methods list, create a new record with the following properties:

    • Name: getPersonInfo

    • Display Name - String Override: Get Person Info

    • Comments: Retrieves a person by Id and returns field values

  4. 4. In the Object Explorer, expand the Business Service Method type and select the Business Service Method Arg type.

  5. 5. In the Business Service Method...

Testing and debugging scripts


The typical task flow for testing and debugging scripts can be described with the following list:

  1. 1. Compile the object definition.

  2. 2. Set breakpoints.

  3. 3. Run the Siebel application in debug mode.

  4. 4. Invoke the script code from the application.

  5. 5. Use the Watch window to verify script operations.

  6. 6. In the case of errors, correct the code and save the script.

  7. 7. Continue from step 4 and repeat until script executes without errors.

  8. 8. Compile the object definition.

Compiling the object definition

Once we have finished the code implementation in the script editor, we must save our work and compile the parent object definition. In the case of our code example, we must compile the new business service named AHA Info Service.

Setting breakpoints

Assuming that we have already defined the Debug settings in the Siebel Tools options dialog (as described in Chapter 2), we can now set breakpoints in our code in order to prepare it for debugging. To accomplish this we set the cursor...

Summary


The Siebel eScript language allows developers to extend the Siebel CRM application logic with custom scripts. Siebel Tools provides a scripting environment for the Application, Applet, Business Component, and Business Service object types.

In this chapter, we learned how to initialize the scripting environment in Siebel Tools and what event handlers and methods are available for scripting.

A short case study scenario demonstrated how to create a custom business service and how to debug it.

In the next chapter, we will discuss advanced aspects of Siebel scripting such as browser scripting, tracing, and performance considerations.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Oracle Siebel CRM 8 Developer's Handbook
Published in: Apr 2011Publisher: ISBN-13: 9781849681865
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Alexander Hansal

Alexander Hansal has worked as an IT professional in small, medium, and global corporations. Since 2001, Alexander works as a technical instructor and consultant for Siebel CRM and Oracle Business Intelligence in Europe. He enjoys teaching, and shares his knowledge and expertise in his classes at Oracle University and in his weblog, http://siebel-essentials.blogspot.com/
Read more about Alexander Hansal