"Trace" statements in Siebel script provides a good way to debug and know what indeed is going on in the background. It is common enough to use the following statements to do debugging in scripts:
1. Open Notepad and type the following lines
3. Open Siebel client as always, navigate to the specific screen of interest
4. Double click on the VBS file to run the script
5. Perform the transaction that needs to be traced, hit 'Enter' in the command prompt of the running script after the transaction
You will find that the trace happens only when the VB script is running. You would still need to have 'Trace' statements in the script for any custom tracing though. A similar approach can be applied for SQL tracing as well (refer to the commented line in the above script).
TheApplication().TraceOn("c:\trace.txt", "Allocation", "All");While this is easy enough, an additional flexibility to trace only when required works out better. This can be easily accomplished using VB Script (not Siebel, stand-alone).
...
...
TheApplication().Trace("Committed to the change " + rowId);
...
TheApplication().TraceOff();
1. Open Notepad and type the following lines
'Reference SiebelApplication object2. Save the file and close it (assume the file is called "COGSiebelLog.vbs")
Set oSiebelApp = CreateObject("TWSiebel.SiebelWebApplication.1")
'Start tracing with appropriate parameters. Uncomment one of the options
oSiebelApp.TraceOn "C:\sbl-trace.txt", "Allocation", "all"
'oSiebelApp.TraceOn "C:\sbl-sql-trace.txt", "sql", "all"
'Continue tracing until stopped
set wshell = CreateObject("Wscript.Shell")
wshell.Run ("%comspec% /c title COGSiebelLog & echo Tracing in Siebel is currently on. & pause"), 1, true
'Stop trace and destroy object
oSiebelApp.TraceOff
set wshell = Nothing
3. Open Siebel client as always, navigate to the specific screen of interest
4. Double click on the VBS file to run the script
5. Perform the transaction that needs to be traced, hit 'Enter' in the command prompt of the running script after the transaction
You will find that the trace happens only when the VB script is running. You would still need to have 'Trace' statements in the script for any custom tracing though. A similar approach can be applied for SQL tracing as well (refer to the commented line in the above script).