I am back with more tips on best practices on Siebel scripting. I will try to continue this series as find more tips. For now I have three more tips for you. Let me know if this helps.
Tip 10: Browser Script versus Server Script
The main purpose of Siebel Browser script is to extend the functionality of the browser. So Browser script should be limited to user based events. On the other side Server Side script is used for data manipulation or anything beyond the capability of the browser.
Browser script is recommended for:
- Communication with the user
- Interaction with desktop applications
- Data validation and manipulation limited to the current record
Server script is recommended for:
- Query, insert, update, and delete operations
- Access to data beyond the current record
So validate your requirement against this best practice.
Tip 11: Nullify Object Variables when no longer needed.
Every variable under eScript that is referenced to an object (oBC = TheApplication().GetBusComp(“Account”);) uses some memory to hold that value. If the script exists abruptly the memory that is being used to hold that value might not get released causing memory leak. To avoid any kind memory leak it is a good practice to null those variables (oBC = null;) after their use. Nulling those variables releases the memory. Common object references that must be nulled are
- Business Objects
- Property Sets
- Business Services
- Business Components
- Applets
The best spot to null these variables are under finally section of the try-catch block of eScript as shown below.
try
{
oAccBO = TheApplication().GetBusObject(”Account”);
oAccBC = oAccBO.GetBusComp(”Account”);
sAccSerExpr = oAccBC. GetSearchExpr();
}
catch(e)
{
//Some Error Handling
}
finally
{
sAccSerExpr = null;
oAccBC = null;
oAccBO= null;
}
Observe that in the code I first null the child objects and then the parent objects.
Tip 12: Get rid of unused code from the Repository
Having a code that has been commented out or not being used causes an unnecessary burden on the server to load the application which could hit performance. If the code is no longer in use just remove them from the objects. But before you delete them make sure you archive (sif) or export it so that in future if you see realize the need for it; you can just import them back into the application.
Hope these tips helps. If you know of any tips and you would like me to publish it over here, please write it and send it to me. I will be very glad to post it over here.
PS: Thanks for all the appreciation and encouragement that I have received till now. I will keep making this website more useful in the future. As usual if you have any questions lets discuss it under the forums section of the website.
Related posts(Auto Generated):





July 7th, 2008 at 8:59 pm
Thanks for the very helpful information. It’s nice to know that there are people like you who are generous and secure enough to share their knowledge
God bless.
July 7th, 2008 at 11:44 pm
Liz, Thanks for your Appreciation. I always like to share my thoughts and views about Siebel but at the same time I wish other people do the same by sharing their knowledge. So please spread the word and let me know if you like to share your knowledge over here. You are more than welcome to participate in contributing to this website.
Thanks Again!
Sridhar
July 18th, 2008 at 6:13 am
[…] You can access the link here. […]
September 26th, 2008 at 4:23 pm
You could at least make sure that your exemple is correct …
October 20th, 2009 at 7:39 am
Hi, Sridhar..thanks for your wondeful inmformation on siebel scripting, keep going..i need some help regarding scripts.. how can we count total number of scripted lines in the repository.. and where the codes resides i mean physical location( i know this is strange but as anxiety i am eager to know this).
October 22nd, 2009 at 7:10 pm
escript works at object level. I dont know of any BC or objects that will account for all the scripts written in the repository.
you can do this in the DB but dont know how best we can get this to the object level. If you find a solution please share with me. Thanks.