Srinivasa Reddy a reader of Siebel Unleashed shared a top tip. I have taken liberty to convert it into a Post rather than just sharing it as it is. I hope Srinivasa doesn’t mind
eScript is indispensable when it comes to Siebel development. We can achive really complex requirements through scripting. We usually work with Business Components, Business Objects and Business Services in Script and working with them we some times directly and sometimes indirectly allocate memory to the objects we declare in Script.
It is important that we deallocate the memory that we allocated in our scripts otherwise it could results in memory leaks and which can lead to performance issues or even Siebel crashes.
How do we determine which variables in our script has resulted in memory allocation and needs to be deallocated by making them ‘null’?
The answer to the question is TraceOn method.
TheApplication().TraceOn method can helps to identify Memory allocated in our scripts and also to identify the SQL that our script is executing.
TraceOn Method Details: Trace method takes 3 arguments
FileName: First argument is the path and filename in which to dump the details
Type: Type arguments tells Trace what kind of details to dump. It can have two values
- Allocation: which will dump the details of Memory Allocation
- SQL: Which will dump the SQL’s that are executed in the background by script.
Selection: It is used when you choose type as “Allocation”. It tells Siebel what type of objects should be traced. It can have 3 possible values
- Script: Traces Scripting objects
- OLE: Traces objects allocated by automation servers
- All: Traces both script and Automation server objects
Usage: Below are some examples of using TraceOn Method
TheApplication().TraceOn(“c:\\trace.txt”,”Allocation”,”All”);
Your code that you want to trace Use Trace off when you want to stop the trace
TheApplication().TraceOff();
Below is sample output that you might get in trace file that you have created.
08/07/08,18:23:08,START,7.8.2.8 [19237] LANG_INDEPENDENT,NEELG,932,1728
08/07/08,18:23:08,ALLOC,1,BusObject,Order Entry (Sales),Script
08/07/08,18:23:08,ALLOC,2,BusComp,Com Work Order - Orders,Script
08/07/08,18:23:11,ALLOC,3,BusComp,Order Entry - Orders,Script
08/07/08,18:23:12,STOP
You can find ample examples and details about it usage in varied ways in bookshelf just go through Siebel Object Interface Reference PDF.

(7 votes, average: 4.29 out of 5)
2 Comments at "How to Trace Siebel?"
Hey that was an excellent post…Thanks Srinivas & Neel..
Nice ppt about debugging scripts is available here: http://www.siebelmagic.com/benq-content/uploads/debug.ppt
Comment Now!