Though scripting should be avoided, it is often common that scripting would become necessary to meet our requirements. So if scripted, it should be done the most efficient way. There are several optimization techniques. Below are some and I will post more in the future.
Tip 1:
Avoid repeated calling of a function if the results returned are the same. Instead cache the value in a variable. Especially avoid repeated calling of the API function like TheApplication().ActiveViewName() as shown below.

Tip2:
Delay Object Instantiation. If the object being used is under a conditional expression then wait till the conditional statement actually evaluates true. This reduces the cost and burden on the server. See the code below.

Make sure you leave some comments.
There are more Tips to come. So stay tuned.
Related posts(Auto Generated):





December 3rd, 2007 at 12:55 pm
Can u plz give me More tips Plz
December 27th, 2007 at 6:00 am
Hi Eashwerprasad,
I have been very busy lately, but I will soon have a new post another best practices.
Thanks,
SiebelGuide
September 3rd, 2008 at 12:47 pm
Perfect suggestions in scripting!!! Hats off to your initiation in posting and updating Siebel newbies. Lakshmi
September 3rd, 2008 at 5:09 pm
Hi Lakshmi,
Thanks for your compliments. But please note that participation from people like you is highly needed to share knowledge and learn more.
So I urge all the visitors to write articles on Siebel and send it to me. I will post those over here by crediting your name on it. This way learning becomes easy.
Thanks,
Sridhar
September 26th, 2008 at 4:30 pm
eScripting Best Practices - Part2 bis
Never write:
“ExectuteQuery()” or “ExecuteQuery()”
but :
“ExecuteQuery(ForwardOnly)” or “ExecuteQuery(ForwardBackward)”
don’t forget Try and Finally to release your BO/BC …