siebel escript

14

Click here to load reader

Post on 19-Oct-2014

6.459 views

Category:

Technology


2 download

DESCRIPTION

The slides for introducing how to use Siebel eScript and some best practies

TRANSCRIPT

Page 1: Siebel eScript

Siebel eScriptSiebel eScript

Page 2: Siebel eScript

22

GoSiebel.com

AgendaAgenda

What’s Siebel E-ScriptWhat’s Siebel E-Script Why to useWhy to use Where to useWhere to use When to useWhen to use How to useHow to use Tips and TricksTips and Tricks

Page 3: Siebel eScript

33

GoSiebel.com

What’s Siebel E-ScriptWhat’s Siebel E-Script

A scripting languageA scripting language The core language is javascriptThe core language is javascript Siebel eScript provides access to Siebel eScript provides access to

local system calls through two local system calls through two objects, Clib and SElib,objects, Clib and SElib,

Page 4: Siebel eScript

44

GoSiebel.com

Siebel Script --outlyingSiebel Script --outlying

Types of Scripts:Types of Scripts: There are two There are two types of scripting available:types of scripting available:

• Server Scripts (eScript or SiebelVB)Server Scripts (eScript or SiebelVB) Execute on the server for web clients or on Execute on the server for web clients or on

the client machine for mobile or dedicated the client machine for mobile or dedicated web clientsweb clients

• Browser Scripts (JavaScript)Browser Scripts (JavaScript) Downloaded to the client and are executed Downloaded to the client and are executed

within the browserwithin the browser

Page 5: Siebel eScript

55

GoSiebel.com

Page 6: Siebel eScript

66

GoSiebel.com

Page 7: Siebel eScript

77

GoSiebel.com

Where to UseWhere to Use

Siebel ToolsSiebel Tools WebWeb

Page 8: Siebel eScript

88

GoSiebel.com

When to useWhen to use

• Data Validation:Data Validation: Complex and Complex and business object/component data business object/component data relationship rules can be writtenrelationship rules can be written

• User Interaction:User Interaction: Specific messages Specific messages to users based on specific inputs – to users based on specific inputs – string concatenation is supportedstring concatenation is supported

• Integration:Integration: Transfer the data to and Transfer the data to and from the external system ,uses include from the external system ,uses include calling a business service, workflow, etccalling a business service, workflow, etc

Page 9: Siebel eScript

99

GoSiebel.com

When to useWhen to use

Page 10: Siebel eScript

1010

GoSiebel.com

How to UseHow to Use

Siebel eScript GuidelinesSiebel eScript Guidelines Siebel eScript CommandsSiebel eScript Commands

Page 11: Siebel eScript

1111

GoSiebel.com

Siebel eScript GuidelinesSiebel eScript Guidelines

Declare your variablesDeclare your variables Consider case sensitivityConsider case sensitivity Use parentheses () with Use parentheses () with

functionsfunctions Use four-digit years in datesUse four-digit years in dates Use the Use the this this object referenceobject reference ……

Page 12: Siebel eScript

1212

GoSiebel.com

Siebel eScript CommandsSiebel eScript Commands

Applet Object MethodsApplet Object Methods Application Object MethodsApplication Object Methods Business Component ObjectsBusiness Component Objects ……

Page 13: Siebel eScript

1313

GoSiebel.com

Tips and TricksTips and Tricks

Scripts are always interpreted (all text in the script is Scripts are always interpreted (all text in the script is parsed), use parsed), use compact notationcompact notation where possible (for where possible (for example):example):

if(foo == bar)if(foo == bar) doSomething();doSomething();

Instead ofInstead of

if(foo == bar) if(foo == bar) {{ doSomething();doSomething(); }}

• Use “Use “eliminationelimination” code to short circuit functions when not ” code to short circuit functions when not needed:needed:

if(isInDoItList(myval)) {if(isInDoItList(myval)) { longChunkOfCode();longChunkOfCode(); }}

Page 14: Siebel eScript

1414

GoSiebel.com

Tips and TricksTips and Tricks• When querying for a business component, activate all When querying for a business component, activate all

fields via the ActivateField() method prior to executing fields via the ActivateField() method prior to executing the query (this is well documented in Siebel Bookshelf). the query (this is well documented in Siebel Bookshelf).

• When querying for BCs try to use a “ForwardOnly” flag When querying for BCs try to use a “ForwardOnly” flag in the ExecuteQuery() method, this forces Siebel to in the ExecuteQuery() method, this forces Siebel to create a forward only cursor which is more efficient than create a forward only cursor which is more efficient than a bi-directional cursor.a bi-directional cursor.

• Be very careful with using “SetFieldValue” within a Be very careful with using “SetFieldValue” within a “PreSetFieldValue” event due to possible undesired “PreSetFieldValue” event due to possible undesired recursion.recursion.

• You can’t throw an error message during the “OnLoad” You can’t throw an error message during the “OnLoad” logic of an applet, (the error goes nowhere). logic of an applet, (the error goes nowhere).