There are several other ways to optimize Siebel scripting but it is also very important to write the code in a way as to reduce the maintenance efforts, help future reference and for best understanding. So in this blog post about Siebel eScripting best practices I will mention tips to address these essential skills needed.
Tip 8: Consolidate Scripts to BC level script or Business Service level script.
There are cases where in a same set block of script is being used at multiple places. A simple example would be a script used in toggle applets where there are multiple applets involved and each applet could be having the same block of script addressing the same functionality. For a developer, a small change in functionality would require him to change multiple objects. This overhead can be reduced if possible, by moving the functionality to either at the Business Component level or at the Business Service level. Then the developer would have to make changes to only one object which effectively saves a lot of overhead and time.
Also keep in mind that lesser the code in your repository better the maintenance efforts and would also help the upgrade process.
Tip 9: Self-Document the scripts with Comments
I can’t stress enough on this trip. There are always times when we look at the other person’s code and we would always wonder why this was done. Also even there are times when a year later or so, our own code would look alien to us. So always use comments sparingly. Commenting is a wonderful way of conveying the meaning of the code.
Each code should start with a commented header explaining the purpose of the code. Then comment the code appropriately at every sections of the code to make the whole script self explanatory. Below is the sample function header.
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
/**********************************************************
* Name: AAG Service PreInvokeMethod
* Author: SiebelGuide.com
* Date Created: 01/25/2008
*
* Purpose/Description: Illustration of how comment header is used
*
* Inputs: Id, SR_ID
* Outputs: Returns status of BS
*
* Revision History:
* 3/1/08 — SiebelGuide.com — Added to update status of SR
* 3/9/08 — Sridhar — Added Email functionality, Enhancement SBL-320
************************************************************/
The header shown above is the most common header used by many developers. Feel free to use the above header in your code.
In my next post I will mention tips to enhance readability and error handling. Till then let me know what you guys think about these tips. Until my next post Adiós..!
Related posts(Auto Generated):





April 13th, 2008 at 6:26 pm
Hi Sridhar,
These tips have been very helpful but do you more of these coming soon?
It was nice reading these tips.
Meg
April 14th, 2008 at 1:33 am
Hi Meghana,
I will post new tips when I will come across them. But definately there will be few tips in the future. Keep checking.
Thanks,
Sridhar