var ExcelApp = COMCreateObject("Excel.Application");
var bb = ExcelApp.visible = true;
//Make Excel visible through the Application object.
// Place some text in the first cell of the sheet
ExcelApp.ActiveSheet.Cells(1,1).Value = "Column A, Row 1";
// Save the sheet
var fileName = "C:\\demo.xls";
ExcelApp.SaveAs (fileName);
// Close Excel with the Quit method on the Application object
ExcelApp.Application.Quit();
// Clear the object from memory
ExcelApp = null;
Friday, November 14, 2008
Wednesday, August 20, 2008
EIM Performance tunning
EIM performance tuning
A quick look at the various strategies available for tuning EIM on Oracle.
EIM is the mechanism used to load large data volumes into a Siebel database.
EIM can also be used for ongoing data loads where data is processed (typically from an external system) to create, update, merge or delete records.
Data quality
EIM can load data fast. Very fast. However, if the data is missing key fields from the source system, the entire data load will have to be repeated. Exhaustive, thorough checking, testing and validation of all data will have significant benefits. EIM performance degrades in direct proportion to the number of rejected records.
Consider using a staging table with multiple check constraints to validate the data and enforce integrity as much as possible.
Testing
Test, test, check and double check the load procedure. Check that data is actually visible in the Siebel application. Failure to populate a single primary column may mean data will not be visible to the end user.
Profiling
Analyse the SQL statements issue by EIM and the performance profile. The IFB parameter SQLPROFILE may be specified to generate a detailed breakdown of each EIM step together with the most resource intensive SQL statements.
Gathering statspack snapshots at the start/end of EIM processing may be used to report on general Oracle performance metrics.
Disable Transaction Logging
Siebel supports mobile web clients (remote users who work in a discinnected mode and synchronise with the Siebel server). For large scale data loads,the Siebel System Preference 'Docking: Transaction Logging' should be set to 'FALSE'. When the data load is complete, mobile web clients should be extracted.
Tune the IFB
ONLY BASE COLUMNS
The parameters 'ONLY BASE TABLES and, in particular, 'ONLY BASE COLUMNS' limit the amount of processing done by EIM. In addition, the resulting IFB documents the data mappings.
DEFAULT/FIXED COLUMNS
The EIM parameter 'DEFAULT COLUMN' and 'FIXED COLUMN' are relatively inefficient. EIM generates an UPFDATE statement for each such column for each batch processed. It is preferable to populate constant values prior to the EIM load either using SQL*Loader or updating the data.
Index hints
Two IFB parameters USE ESSENTIAL INDEX HINTS (default=TRUE) and USE INDEX HINTS (default=FALSE) should usually both be set to TRUE on Oracle. The parameters issue additional index hints to choose the appropriate indexes.
Direct path inserts
EIM also supports direct path inserts. The IFB parameter 'ORACLE INSERT APPEND MODE = TRUE' should be specified. This will add the /*+ APPEND */ hint to all insert statements.
Direct path load locks the target table. However, this isn't an issue here as the insert operation is the last part of EIM processing and is followed by a commit.
Tune the batch size
EIM processes data in batches. The size of each batch is determined by the IF_BATCH_NUM column in the EIM interface table. It is worth experimenting with batch size between 2,500 and 25,000 to determine the optimal value. There isn't a massive difference and 5,000 or 10,000 is normally a decent choice (and helps makes the sums easier).
Index monitoring
Maintaining all those indexes is expensive. Oracle provides a feature to monitor index usage. This technique can be used to enable index monitoring, execute an EIM data load. Any non-unique indexes that were not used during EIM processing may be dropped.
The necessary DDL to re-create the indexes should be captured. This allows the indexes to be reinstated when data loading is complete. Parallel index creation may be used to create the indexes quickly. The Siebel DDLSYNC utility will also recreate any missing indexes but is sequential (and relatively slow).
Tune Oracle
Siebel is an OLTP application with users connecting using a web browser. EIM is a batch application. Consequently, there is scope to reconfigure the SGA. The size of the shared pool may be reduced and the memory allocated to the buffer cache.
Pre-allocate tablespace
For large data loads, it is recommended to pre-allocate the necessary tablespace. Dynamic extent allocation is expensive and should be avoided.
Redo logs
EIM generates large volumes of redo information. In addition to the actual insert's of new records into the target tables, EIM performs updates on the EIM interface tables to set and modify status values. In addition, some primary columns will also result in update statements.
Parallelism
The final step of EIM tuning should be to run multiple EIM processes in parallel. EIM is database intensive and consumes relatively few resources on the Siebel application server. With modern disk storage technologies, the limiting factor for EIM throughput should be the CPU resources on the database server.
A quick look at the various strategies available for tuning EIM on Oracle.
EIM is the mechanism used to load large data volumes into a Siebel database.
EIM can also be used for ongoing data loads where data is processed (typically from an external system) to create, update, merge or delete records.
Data quality
EIM can load data fast. Very fast. However, if the data is missing key fields from the source system, the entire data load will have to be repeated. Exhaustive, thorough checking, testing and validation of all data will have significant benefits. EIM performance degrades in direct proportion to the number of rejected records.
Consider using a staging table with multiple check constraints to validate the data and enforce integrity as much as possible.
Testing
Test, test, check and double check the load procedure. Check that data is actually visible in the Siebel application. Failure to populate a single primary column may mean data will not be visible to the end user.
Profiling
Analyse the SQL statements issue by EIM and the performance profile. The IFB parameter SQLPROFILE may be specified to generate a detailed breakdown of each EIM step together with the most resource intensive SQL statements.
Gathering statspack snapshots at the start/end of EIM processing may be used to report on general Oracle performance metrics.
Disable Transaction Logging
Siebel supports mobile web clients (remote users who work in a discinnected mode and synchronise with the Siebel server). For large scale data loads,the Siebel System Preference 'Docking: Transaction Logging' should be set to 'FALSE'. When the data load is complete, mobile web clients should be extracted.
Tune the IFB
ONLY BASE COLUMNS
The parameters 'ONLY BASE TABLES and, in particular, 'ONLY BASE COLUMNS' limit the amount of processing done by EIM. In addition, the resulting IFB documents the data mappings.
DEFAULT/FIXED COLUMNS
The EIM parameter 'DEFAULT COLUMN' and 'FIXED COLUMN' are relatively inefficient. EIM generates an UPFDATE statement for each such column for each batch processed. It is preferable to populate constant values prior to the EIM load either using SQL*Loader or updating the data.
Index hints
Two IFB parameters USE ESSENTIAL INDEX HINTS (default=TRUE) and USE INDEX HINTS (default=FALSE) should usually both be set to TRUE on Oracle. The parameters issue additional index hints to choose the appropriate indexes.
Direct path inserts
EIM also supports direct path inserts. The IFB parameter 'ORACLE INSERT APPEND MODE = TRUE' should be specified. This will add the /*+ APPEND */ hint to all insert statements.
Direct path load locks the target table. However, this isn't an issue here as the insert operation is the last part of EIM processing and is followed by a commit.
Tune the batch size
EIM processes data in batches. The size of each batch is determined by the IF_BATCH_NUM column in the EIM interface table. It is worth experimenting with batch size between 2,500 and 25,000 to determine the optimal value. There isn't a massive difference and 5,000 or 10,000 is normally a decent choice (and helps makes the sums easier).
Index monitoring
Maintaining all those indexes is expensive. Oracle provides a feature to monitor index usage. This technique can be used to enable index monitoring, execute an EIM data load. Any non-unique indexes that were not used during EIM processing may be dropped.
The necessary DDL to re-create the indexes should be captured. This allows the indexes to be reinstated when data loading is complete. Parallel index creation may be used to create the indexes quickly. The Siebel DDLSYNC utility will also recreate any missing indexes but is sequential (and relatively slow).
Tune Oracle
Siebel is an OLTP application with users connecting using a web browser. EIM is a batch application. Consequently, there is scope to reconfigure the SGA. The size of the shared pool may be reduced and the memory allocated to the buffer cache.
Pre-allocate tablespace
For large data loads, it is recommended to pre-allocate the necessary tablespace. Dynamic extent allocation is expensive and should be avoided.
Redo logs
EIM generates large volumes of redo information. In addition to the actual insert's of new records into the target tables, EIM performs updates on the EIM interface tables to set and modify status values. In addition, some primary columns will also result in update statements.
Parallelism
The final step of EIM tuning should be to run multiple EIM processes in parallel. EIM is database intensive and consumes relatively few resources on the Siebel application server. With modern disk storage technologies, the limiting factor for EIM throughput should be the CPU resources on the database server.
Tuesday, August 5, 2008
About Runtime Events
What is it? Siebel allows you to detect events on the Application, Applet or BusComp Objects. You can take an action or multiple actions on these events. For instance you can set profile attributes, or you can call a Business service or a workflow. When do you use it? Say when the Effective Start Date is set on the Service Agreement, On the pre write record of Business Component, You want to call a Business Service to validate a lot of different conditions... That is when you will define an action set to SetProfileAttribute for Account Id and then call the Business Service or a workflow. Siebel Version Runtime events is available in Siebel v7.5 onwards. The instructions/example in this blog is from siebel 7.8. to access siebel runtime events screen login to Siebel Client. Go to Sitemap --> Runtime Events Administration. Some common RuntimeEvents: Listed below are some commonly used events for each object Applet: InvokeMethod PreInvokeMethod DisplayApplet BusComp: PreSetFieldValue SetFieldValue PreWriteRecord WriteRecord Query PreQuery NewRecord PreNewRecord Application Login Logout Timeout ViewActivated Some Sample Actionsets: To create an actionset 1.Login to siebel client 2.go to Sitemap --> Administration - Runtime Events --> Action Sets 3.Click New, and enter Name = Test Actionset Start Date = Yesterday's date Active = Y Enable Export = Y 4. Create a New Record in the child applet, and enter Name = SetProfileAttr1 Action Type = Attribute Set Sequence = 1 Profile Attribute = SetOperator = Set Value = 5. Create another New Record, and enter Name = Effective Date Validation Action Type = BusService Sequence = 3 Business Service Name = Workflow Process Manager Business Service Method = RunProcess Business Service Context = "ProcessName", "Contract Validation Workflow" Example of Events Now lets say you want to call this actionset Before Write record event of "Service Agreement". Here is what you will do to achieve this: Go to Events View and create a New Record: Sequence = 1 Object = BusComp Object Name = Service Agreement Event = PreWriteRecord Action Set Name = Contract Start Date Validation Actionset How to know what events are called when your application is running? Now In Order to know what is the Sequence of Events which is called when you do a certain operation in Siebel, do the following: To know the sequence of events that are fired, enable the personalization log in your thick client by setting the following 2 parameters in your cfg file: EnablePersonalization = TRUE PersonalizationLog = C:\Personal.log
Siebel Integration with Java and C++ - Java Business Service
Siebel Java Business Service in fact is a very powerful feature that allows easy integration with any Java packages and provides functionality within Siebel environment. Try to imagine that you'll able to:
Perform asynchronous operations using thread paradigm
Create mechanism of effective callback without context
Create additional graphic elements using SWING or anything else
Implement effective client/server mechanism etc...Example of implementation:package com.mycompany.jbs;import com.siebel.data.SiebelPropertySet;import com.siebel.eai.SiebelBusinessServiceException;public class AddBusinessService extends com.siebel.eai.SiebelBusinessService {public void doInvokeMethod(String methodName, SiebelPropertySet input,SiebelPropertySet output) throws SiebelBusinessServiceException {String a = input.getProperty("a");String b = input.getProperty("b");if (a == null a.equals("") (b == null) b.equals(""))throw new SiebelBusinessServiceException("NO_PAR", "Missing param");if (!methodName.equals ("GetSum"))throw new SiebelBusinessServiceException("NO_SUCH_METHOD", "No such method");else {int a = 0;int b = 0;try {a = Integer.parseInt(X);b = Integer.parseInt(Y);}catch (NumberFormatException e) {throw new SiebelBusinessServiceException("NOT_INT", "Non-integer passed");}int result = a + b;output.setProperty("result", new Integer(result).toString());}}}Due to actual neediness of Java runtime in Siebel environment, the usage of such an ability becomes to be relatively easy. Maybe the main drawback is managing of Java sub-system in distributed Siebel environment.
Perform asynchronous operations using thread paradigm
Create mechanism of effective callback without context
Create additional graphic elements using SWING or anything else
Implement effective client/server mechanism etc...Example of implementation:package com.mycompany.jbs;import com.siebel.data.SiebelPropertySet;import com.siebel.eai.SiebelBusinessServiceException;public class AddBusinessService extends com.siebel.eai.SiebelBusinessService {public void doInvokeMethod(String methodName, SiebelPropertySet input,SiebelPropertySet output) throws SiebelBusinessServiceException {String a = input.getProperty("a");String b = input.getProperty("b");if (a == null a.equals("") (b == null) b.equals(""))throw new SiebelBusinessServiceException("NO_PAR", "Missing param");if (!methodName.equals ("GetSum"))throw new SiebelBusinessServiceException("NO_SUCH_METHOD", "No such method");else {int a = 0;int b = 0;try {a = Integer.parseInt(X);b = Integer.parseInt(Y);}catch (NumberFormatException e) {throw new SiebelBusinessServiceException("NOT_INT", "Non-integer passed");}int result = a + b;output.setProperty("result", new Integer(result).toString());}}}Due to actual neediness of Java runtime in Siebel environment, the usage of such an ability becomes to be relatively easy. Maybe the main drawback is managing of Java sub-system in distributed Siebel environment.
Monday, August 4, 2008
Server Script Run for Each Client
Scripting on server side events, also known as server script, runs inside the Siebel Object Manager. This means where the server script runs depends upon where the Siebel Object Manager runs. This varies for different types of architecture, as follows:
Siebel Web Client
In both High Interactivity and Standard Interactivity modes, the Siebel Web Client connects to the Siebel Web Server, then to the Siebel Server. The Siebel Web Client uses the Object Manager residing in the Siebel Server to support its functionality. In this circumstance, the server script runs on the Siebel Server.
Siebel Dedicated Web Client and Siebel Mobile Web Client
The Siebel Dedicated Web Client and Siebel Mobile Web Client run a local version of the Application Object Manager on the machine where the client resides. In this circumstance, the server script runs in the client machine.
Impact on Scripting
The awareness of the above differences is critical for scripting, especially when the script accesses environment-specific references, components, or data sources. For example:
If the server is on a UNIX operating system, the server script running on it must be written in eScript, because there is no Siebel VB script engine on the UNIX environment.
When using server script to directly access files, the awareness of your local file system is very important, since different machines may have a different file system hierarchy and different file access permissions.
Using COM objects to access external applications is a common practice on server script, but it is not possible if the server script runs on a UNIX platform.
Siebel Web Client
In both High Interactivity and Standard Interactivity modes, the Siebel Web Client connects to the Siebel Web Server, then to the Siebel Server. The Siebel Web Client uses the Object Manager residing in the Siebel Server to support its functionality. In this circumstance, the server script runs on the Siebel Server.
Siebel Dedicated Web Client and Siebel Mobile Web Client
The Siebel Dedicated Web Client and Siebel Mobile Web Client run a local version of the Application Object Manager on the machine where the client resides. In this circumstance, the server script runs in the client machine.
Impact on Scripting
The awareness of the above differences is critical for scripting, especially when the script accesses environment-specific references, components, or data sources. For example:
If the server is on a UNIX operating system, the server script running on it must be written in eScript, because there is no Siebel VB script engine on the UNIX environment.
When using server script to directly access files, the awareness of your local file system is very important, since different machines may have a different file system hierarchy and different file access permissions.
Using COM objects to access external applications is a common practice on server script, but it is not possible if the server script runs on a UNIX platform.
Thursday, July 31, 2008
Index
Although the best performance improvement can be seen when a column has an index created on it. However, care must be taken while deciding whether to create an index or not. Below are some of the tips to decide,
When To Create an Index
When you have large table
When the table is mainly used for queries
When you generally query the table for one or few distinct values
When large number of NULLs are in the column
When Not To Create An Index
When you have small table
When users make DML (Data Manipulation Language) changes to the table frequently
When your query results contain substantial portions of the data the table actually stores
When table is updated frequently
When To Create an Index
When you have large table
When the table is mainly used for queries
When you generally query the table for one or few distinct values
When large number of NULLs are in the column
When Not To Create An Index
When you have small table
When users make DML (Data Manipulation Language) changes to the table frequently
When your query results contain substantial portions of the data the table actually stores
When table is updated frequently
Wednesday, July 16, 2008
Profile Attributtes
Profile Attributes I stumbled upon them in siebel when I was working on my first assignment involving Siebel EAI. Till that time I had only used and heard of Global Variables which you could use throught out your script.But as the requirement said only if user clicked a button in View A and then performed some particular action in View B trigger a workflow.As views involved had different BC's it was not possible to have done through global variables. Then my senior colluege introduced me to a new entity in siebel called 'Profile Attributes'. They are important because they have a unique property. They are available throughout the application. The best term that comes to my mind to describe them is 'Session Variables'. Those who have worked a little bit on development of Web Application will understand exactly what I am saying and for those who hasn't worked on them I will explain.
As you know from siebel 7 onwards it has Web Architecture. So, as soon as you login into siebel through your browser a session is started which last till time you log out or you close your browser window or according to the length set through session parameter at server level.Now discussing in details that how server maintains this session and what goes on behind the scene is out of scope of this article but what you need to know is that Siebel server recognises every unique user through session id that is given to you when you login to siebel and it remains valid until you session closes due to above mentioned reasons. So, Profile Attributes are variables that can hold any value during the session of the user. There are two methods available to in siebel escript that help you to work with Profile Attributes.
GetProfileAttr
SetProfileAttr
GetProfileAttr method is used to retrieve the value of a particular profile attribute. The syntax is
TheApplication().GetProfileAttr("ProfileAttrName")
SetProfileAttr method is used to set the value of Profile Attribute. If the Profile Attribute that you mention is not already existing it creates a new Profile Attribute. The syntax is
TheApplication().SetProfileAttr("ProfileAttrName",Value)
So, to accomplish the our requirement we Set a profile attribute when clicked the button on view A and then when he went to View B and did the particular action we wanted we retrieved the value of the profile attribute and if all the conditions were met we executed the workflow and everybody developed happily ever after :)
But, there is a twist in the story and it was not a happy ending after all which highlights the fragile nature of Profile Attributes. Now, in a particular situation this solution won't work. If user clicked button on View A and then logged off which meant profile attribute is destroyed hence the functionality failed. So, as you all must have guessed this solution was scrapped :(
So, the moral of the story is use Profile Attributes with caution and only if you are sure that if the session is destroyed you functionality wouldn't fail.
As you know from siebel 7 onwards it has Web Architecture. So, as soon as you login into siebel through your browser a session is started which last till time you log out or you close your browser window or according to the length set through session parameter at server level.Now discussing in details that how server maintains this session and what goes on behind the scene is out of scope of this article but what you need to know is that Siebel server recognises every unique user through session id that is given to you when you login to siebel and it remains valid until you session closes due to above mentioned reasons. So, Profile Attributes are variables that can hold any value during the session of the user. There are two methods available to in siebel escript that help you to work with Profile Attributes.
GetProfileAttr
SetProfileAttr
GetProfileAttr method is used to retrieve the value of a particular profile attribute. The syntax is
TheApplication().GetProfileAttr("ProfileAttrName")
SetProfileAttr method is used to set the value of Profile Attribute. If the Profile Attribute that you mention is not already existing it creates a new Profile Attribute. The syntax is
TheApplication().SetProfileAttr("ProfileAttrName",Value)
So, to accomplish the our requirement we Set a profile attribute when clicked the button on view A and then when he went to View B and did the particular action we wanted we retrieved the value of the profile attribute and if all the conditions were met we executed the workflow and everybody developed happily ever after :)
But, there is a twist in the story and it was not a happy ending after all which highlights the fragile nature of Profile Attributes. Now, in a particular situation this solution won't work. If user clicked button on View A and then logged off which meant profile attribute is destroyed hence the functionality failed. So, as you all must have guessed this solution was scrapped :(
So, the moral of the story is use Profile Attributes with caution and only if you are sure that if the session is destroyed you functionality wouldn't fail.
Siebel CRM How to Restrict a Field to Only Accept Certain Characters
We have a multilingual application and we have Unicode enabled database but still we would like to restrict user from entering certain characters.
We want to prevent user from entering numbers in alpha-numeric fields.Solution:Use charCodeAt function given by Siebel but not documented properly by Siebel. Here I am giving a Pseudo code to explain how it can be used.if (FieldName == "First Name") {for (var i=0;i less than field length ;i++) {var ASCII_code = fieldvalue.charCodeAt(i)if(ASCII_code is not valid code)Error("Not Valid Code");}} charCodeAt() returns the ASCII code of the character that is supplied to it. ASCII code comparison is way faster than the number function that are used to compare strings so we can also use this function where we want to compare two strings by just modifying the above given Pseudo code.Hope this helps! If yes, Please put your comments below.
We want to prevent user from entering numbers in alpha-numeric fields.Solution:Use charCodeAt function given by Siebel but not documented properly by Siebel. Here I am giving a Pseudo code to explain how it can be used.if (FieldName == "First Name") {for (var i=0;i less than field length ;i++) {var ASCII_code = fieldvalue.charCodeAt(i)if(ASCII_code is not valid code)Error("Not Valid Code");}} charCodeAt() returns the ASCII code of the character that is supplied to it. ASCII code comparison is way faster than the number function that are used to compare strings so we can also use this function where we want to compare two strings by just modifying the above given Pseudo code.Hope this helps! If yes, Please put your comments below.
Next Record & Delete Record use with Caution
Number of times we have written code in which we have to traverse number of records in a loop and n number of times we have missed one important statement that results in our code to stuck in infinite loop. Yes, I am talking about the statement Object.NextRecord()This statment is generally used at the end of the loop so that after all the processing is complete we move on to the next record in the record set and perform processing on the next record. I am giving a Psuedo code to explain that.while(not end of recordset){perform operation recordset.NextRecord()}But here I am going to to tell you about a situation where doing a NextRecord(). will result in problems. Yes, I we are deleting the records in the loop then we don't need to use the NextRecord() function.Reason for that is using DeleteRecord() results in pointer to moved to next record automatically and if we use NextRecord then it will result in skipping of the last record we are trying to delete. Pseudo to explain thiswhile(not end of RecordSet){do processingrecordset.DeleteRecord();// recordset.NextRecord(); // no need to use next record as delete will automatically move the pointer to next line}
Picklists/Pickmaps
Often we forget one thing or other while making a Picklist. Here is some trobleshooting guideline for the same, hope you all would enjoy this
A Pickmap determines which Fields from the pick BusComp will be copied to the BusComp in which the Field with a Picklist is defined.
- When there is a static Picklist and no defined Pickmap, the user will not see a list of values to make his selection.
- When there is a dynamic Picklist and no defined Pickmap, nothing will be copied from the source BusComp.
- When the Pickmap is defined, but does not contain a mapping to a foreign key column on the base table, no reference will be saved to the base record and the update is lost.
- For Fields, that do not have a Picklist attribute defined, there should be no Pickmaps either.
- If a Pickmap is a copy Pickmap, then the value of the Field in the Picklist business component will be automatically copied into the Field of the parent business component specified by the Field property.
A Pickmap specifies instructions for copying Fields when a Picklist is used by a Field, for example to identify which Field must be populated with Picklist values when a Picklist item is chosen. Missing Pickmaps will result in Field values not being populated from the Picklist and an error could occur in the application.
A Pickmap determines which Fields from the pick BusComp will be copied to the BusComp in which the Field with a Picklist is defined.
- When there is a static Picklist and no defined Pickmap, the user will not see a list of values to make his selection.
- When there is a dynamic Picklist and no defined Pickmap, nothing will be copied from the source BusComp.
- When the Pickmap is defined, but does not contain a mapping to a foreign key column on the base table, no reference will be saved to the base record and the update is lost.
- For Fields, that do not have a Picklist attribute defined, there should be no Pickmaps either.
- If a Pickmap is a copy Pickmap, then the value of the Field in the Picklist business component will be automatically copied into the Field of the parent business component specified by the Field property.
A Pickmap specifies instructions for copying Fields when a Picklist is used by a Field, for example to identify which Field must be populated with Picklist values when a Picklist item is chosen. Missing Pickmaps will result in Field values not being populated from the Picklist and an error could occur in the application.
Cascade Delete Property
Here is another good one. Tip for Cascade Delete Property on New Link Definitions and believe me its very useful. Here it goes
- The property should be set to “Delete”, if the child record has no other relationships through other links. This happens often when using a _XM table for the child BusComp. Without the parent record, the child _XM record is not necessary and should be deleted.
- Set the value to “Clear”, if the link defines a 1:M relationship, but the value could be related to another record through another link (e.g. an activity record, which can be associated to a contact as well as to an account).
Ensure that the FK reference on the activity record is cleared, indicating that there is no longer an account associated to the activity before deleting the related account. the activity should not be deleted, as it still has a relationship to a valid contact.
- The property should be left as “None”, if the link uses an intersection table (M:M).
- Set the Inter Child Delete propert to “TRUE” for a M:M link as long as a child intersection record should be deleted when a parent record is deleted.
- The property should be set to “Delete”, if the child record has no other relationships through other links. This happens often when using a _XM table for the child BusComp. Without the parent record, the child _XM record is not necessary and should be deleted.
- Set the value to “Clear”, if the link defines a 1:M relationship, but the value could be related to another record through another link (e.g. an activity record, which can be associated to a contact as well as to an account).
Ensure that the FK reference on the activity record is cleared, indicating that there is no longer an account associated to the activity before deleting the related account. the activity should not be deleted, as it still has a relationship to a valid contact.
- The property should be left as “None”, if the link uses an intersection table (M:M).
- Set the Inter Child Delete propert to “TRUE” for a M:M link as long as a child intersection record should be deleted when a parent record is deleted.
Use Default Sensitivity and CaseInsensitive
A TRUE or FALSE value.
For fields of type DTYPE_ID
Queries are case-sensitive if
Use Default Sensitivity is TRUE and
CaseInsensitive setting in the CFG file is FALSE.
Queries are case-insensitive if
Use Default Sensitivity is TRUE and
CaseInsensitive setting is TRUE.
For Id fields not exposed in the business component (such as the ID field in Opportunity), the User Default Security property cannot be set.
For fields of type DTYPE_ID
Queries are case-sensitive if
Use Default Sensitivity is TRUE and
CaseInsensitive setting in the CFG file is FALSE.
Queries are case-insensitive if
Use Default Sensitivity is TRUE and
CaseInsensitive setting is TRUE.
For Id fields not exposed in the business component (such as the ID field in Opportunity), the User Default Security property cannot be set.
Immediate Post Changes
Calculated fields are not automatically refreshed when a related field value changes; they are refreshed only after committing the record. To have them refresh immediately after the fields have been changed the Immediate Post Changes property of the field needs to be set to TRUE.
Property Description
A TRUE or FALSE value.
Field data is posted to the server when the focus moves off of the field and then the data is refreshed. Setting this property to TRUE causes an immediate roundtrip to the server.
When set to True the browser script PreSetFieldValue event is bypassed.
Typically used for constrained drop-down lists and calculated fields
Property Description
A TRUE or FALSE value.
Field data is posted to the server when the focus moves off of the field and then the data is refreshed. Setting this property to TRUE causes an immediate roundtrip to the server.
When set to True the browser script PreSetFieldValue event is bypassed.
Typically used for constrained drop-down lists and calculated fields
How can a MVF be configured to be a required field?
Currently, the standard Siebel application does not provide the ability to make a multi value field “required”.
The solution currently available right now is to write Visual Basic (VB) code to enforce the business requirement.
The Sample VB code to make the Street Address Multi Value Field to be a
required field would be:
Function BusComp_PreWriteRecord As Integer
DIM streetAddress AS String
streetAddress = “”
Me.ActivateField(”Street Address”)
streetAddress = Me.getFieldValue(”Street Address”)
If NOT len(streetAddress) > 0 then
MsgBox “Please Enter Street Address”
BusComp_PreWriteRecord = CancelOperation
exit Function
end if
BusComp_PreWriteRecord = ContinueOperation
End Function
The solution currently available right now is to write Visual Basic (VB) code to enforce the business requirement.
The Sample VB code to make the Street Address Multi Value Field to be a
required field would be:
Function BusComp_PreWriteRecord As Integer
DIM streetAddress AS String
streetAddress = “”
Me.ActivateField(”Street Address”)
streetAddress = Me.getFieldValue(”Street Address”)
If NOT len(streetAddress) > 0 then
MsgBox “Please Enter Street Address”
BusComp_PreWriteRecord = CancelOperation
exit Function
end if
BusComp_PreWriteRecord = ContinueOperation
End Function
Sort Specification
If two or more applets which are based on same Business Component have require different sort specifications, copying the business component is not required in order to apply the sort specifications individually. The following example snippet in the Applet Load event helps to implement required sort specification with the same business component
Personalization Administration: Applet visibility controlPersonalization Administration could be used to provide additional visibility controls for Ap
Personalization Administration could be used to provide additional visibility controls for Applets and Views.
It is widely known that one could hide an applet in the view from a user with particular Primary Responsibility by using following expression in Administration - Personalization > Applets view using conditional Expression for a given Applet name:
GetProfileAttr(”Primary Responsibility Name”) = <”Responsibility Name”>
There are other supported Profile Attributes, which are lesser know and hardly documented. One of these is ‘GetProfileAttrAsList’.
The following expression could be used in order to compare a value with the user’s responsibilities list and not just the Primary Responsibility.
InList(”ERM Manager”, GetProfileAttrAsList(”User Responsibilities”))
Note that “ERM Manager” is the value for the responsibility you are comparing to.
You can also find some additional postings on Support web regarding these by using “GetProfileAttrList” as the search key word.
Typical application for this information is when configuring Customized/personalized Home Pages for different level of users(Sales Rep, Team Lead, VP/Executives etc).
It is widely known that one could hide an applet in the view from a user with particular Primary Responsibility by using following expression in Administration - Personalization > Applets view using conditional Expression for a given Applet name:
GetProfileAttr(”Primary Responsibility Name”) = <”Responsibility Name”>
There are other supported Profile Attributes, which are lesser know and hardly documented. One of these is ‘GetProfileAttrAsList’.
The following expression could be used in order to compare a value with the user’s responsibilities list and not just the Primary Responsibility.
InList(”ERM Manager”, GetProfileAttrAsList(”User Responsibilities”))
Note that “ERM Manager” is the value for the responsibility you are comparing to.
You can also find some additional postings on Support web regarding these by using “GetProfileAttrList” as the search key word.
Typical application for this information is when configuring Customized/personalized Home Pages for different level of users(Sales Rep, Team Lead, VP/Executives etc).
Call to NextRecord after a call to DeleteRecord
DeleteRecord moves the record pointer automatically to the next record in the record set. The record pointer will move twice if a call to NextRecord is made after a call to DeleteRecord. The consequence is that just every 2nd record will be deleted because a record will be skipped.
So we need to be more cautious while designing such scripts.
So we need to be more cautious while designing such scripts.
Sunday, June 1, 2008
BC UndoRecord – a new learning
BC UndoRecord Method.
Requirement:
If user changes a field value make a flag true
If user hits ESC key or does an undo record then set the flag to false.
Solution:
On SetField value event write the script to make the set the flag as true.Problem:
The problem that we faced was:
If user changes the value the flag is set to true but if user click on Undo Record or hits ESC key then that flag was not being set to false. We explicitly coded in PreInvoke of BC
if (MethodName == “UndoRecord”){ Set the flag to false}
But this code was not firing.
Reason:
BC UndoRecord is only called if user does something which results in ChangeRecord event to fire. In simple words BC UndoRecord is only called if user copies or creates a new record and hits ESC key.
In case user changes a field value and then hits ESC key only Applet Undo Record is called not BC UndoRecord method
Solution:
On Applet write the following script.
if (MethodName == “UndoRecord”){ this.BusComp().InvokeMethod(“UndoRecord”); }
Requirement:
If user changes a field value make a flag true
If user hits ESC key or does an undo record then set the flag to false.
Solution:
On SetField value event write the script to make the set the flag as true.Problem:
The problem that we faced was:
If user changes the value the flag is set to true but if user click on Undo Record or hits ESC key then that flag was not being set to false. We explicitly coded in PreInvoke of BC
if (MethodName == “UndoRecord”){ Set the flag to false}
But this code was not firing.
Reason:
BC UndoRecord is only called if user does something which results in ChangeRecord event to fire. In simple words BC UndoRecord is only called if user copies or creates a new record and hits ESC key.
In case user changes a field value and then hits ESC key only Applet Undo Record is called not BC UndoRecord method
Solution:
On Applet write the following script.
if (MethodName == “UndoRecord”){ this.BusComp().InvokeMethod(“UndoRecord”); }
On Field Update Invoke
The On Field Update Invoke user property is a clean way to run some custom functionality when a BusComp field is updated. If you reflexively assume that you need to put script in the SetFieldValue event, you should consider this user property to execute your specialized functionality instead.The syntax is as follows:User Property Name: On Field Update Invoke nUser Property Value: "[FieldToCheck]", "[BusCompName]", "[MethodName]", "[Condition]"Condition is an optional parameter. If you leave it out, the method will be called any time the field is updated. If you include it, the condition must be true for the method to be invoked.FieldToCheck is also optional. If the parameter is omitted, include double quotes as a placeholder. The method will be invoked any time the BusComp is updated, as if it were called from the BusComp_WriteRecord event. If the parameter is present, the user property works just like BusComp_SetFieldValue; the update happens as soon as the cursor leaves the FieldToCheck field.Note that you can run a BusComp method on a different BusComp than the one that spawns the event. Specify the BusCompName and the MethodName. Siebel does this quite extensively (for updating child records when a parent record is updated, for example) to implement vanilla functionality. The BusComp method is invoked on another business component in the active Business Object.It is also important to understand what methods can be called from this user property. It can be used to call an eScript function. You can add eScript to the BusComp_PreInvokeMethod event to capture the invocation and call a function on the current BusComp, and from there invoke a workflow process or business service. The user property can also invoke methods on the Business Component Class that would normally be invoked through the InvokeMethod method. For example, you could call the CompleteActivity method on an Activity. Be aware of the specialized methods that are available for the class you are using.If your implementation includes Siebel Order Management, Signals can also be raised from this user property. For any of the Order Management Business Components, if a method is not found on the business component itself, Siebel will raise a signal if it exists.Whatever you choose, Siebel recommends the On Field Update Invoke user property as preferable to adding scripting to the BusComp_SetFieldValue event. The SetFieldValue event is inefficient, and even though the On Field Update Invoke user property may invoke a custom script, it can be more efficient than invoking the same script from the SetFieldValue event.
Friday, May 30, 2008
Text Lenth
One of my favorite User Properties is "Text Length Override". It is a simple technique for enforcing the length of a text field without ugly popup messages.If you have a business requirement to restrict user input to a certain number of characters, you have several options. You can find a database column that has the exact number of characters you need. You can create a field validation that will popup an error message if a user enters more characters than required. The user must correct the error condition before being allowed to step off the field. You can do something even more intrusive (with scripting, for example) to alert the user that he or she has made a mistake and/or fix the problem for them.But a completely non-intrusive, transparent, and elegant way to address the situation is to use the Text Length Override User Property on the field. Text Length Override is a User Property that corrects what almost seems to be a defect in the normal functioning of a BusComp field. It seems intuitive that a field attribute called "Text Length" would set a limit to the amount of text that could be entered into a field. Probably most people wouldn't bother to look that one up. But the fact is that Text Length does nothing at all unless combined with the Text Length Override User Property. The amount of text that a field will accept is normally determined by the size of the underlying database column.So how does this work? Suppose the following:
You have a BusComp Field called "Short Name".
The field is mapped to a column called ALIAS_NAME, which is a varchar(100).
The business requires that no more than 30 characters of text can be entered into Short Name.Here's what you need to do if you want to prevent excess text from being entered, but you don't want a validation message to interrupt the user interaction with the view:
Set the Text Length attribute on the Short Name field to 30
Create a User Property object as a child of the Field.
Set the Name attribute of the User Property to "Text Length Override".
Set the Value of the User Property to "True".*
That's all. The User Property "overrides" the normal functionality of the Text Length attribute (it normally doesn't do anything), and limits the text to the Text Length specified.
You have a BusComp Field called "Short Name".
The field is mapped to a column called ALIAS_NAME, which is a varchar(100).
The business requires that no more than 30 characters of text can be entered into Short Name.Here's what you need to do if you want to prevent excess text from being entered, but you don't want a validation message to interrupt the user interaction with the view:
Set the Text Length attribute on the Short Name field to 30
Create a User Property object as a child of the Field.
Set the Name attribute of the User Property to "Text Length Override".
Set the Value of the User Property to "True".*
That's all. The User Property "overrides" the normal functionality of the Text Length attribute (it normally doesn't do anything), and limits the text to the Text Length specified.
Search Specification Performance
With a web-based application such as Siebel, performance is always a primary concern, especially database performance. Database performance problems can cause ripple effects, as a bad-performing query can cause an increased load on the database, making it slow to respond to other, simpler queries. If a query runs several times (for example, when a user scrolls through a list applet, causing multiple fetches from a slow-performing cursor) database performance problems can become the Achilles heel of a Siebel implementation, and network slowdowns can compound this problem, as multiple fetches are added to multiple network round trips.
One easy way to attack database performance from the outset is by examining Search Specifications and Sort Specifications configured in your Business Components, Applets, and Pre-Defined Queries. Searches and Sorts should use indexed columns whenever possible, and you should be careful not to defeat your indexes by searching on an expression that will not use one. For example, avoid using "OR" in your search expressions, because the expression is simply copied to the WHERE clause of the query, and databases generally do a full table scan on an "OR" condition.
If you have any doubts about the performance of a particular search, compile the SRF, spool the SQL, and ask your DBA to run the explain plan. He or she can tell you if your query is performing optimally. Siebel performance can be a little bit tricky, because you don't write the SQL yourself, and you can't actually provide database hints. But when you are writing Search Expressions, you may have more control over the generated SQL than you realize
One easy way to attack database performance from the outset is by examining Search Specifications and Sort Specifications configured in your Business Components, Applets, and Pre-Defined Queries. Searches and Sorts should use indexed columns whenever possible, and you should be careful not to defeat your indexes by searching on an expression that will not use one. For example, avoid using "OR" in your search expressions, because the expression is simply copied to the WHERE clause of the query, and databases generally do a full table scan on an "OR" condition.
If you have any doubts about the performance of a particular search, compile the SRF, spool the SQL, and ask your DBA to run the explain plan. He or she can tell you if your query is performing optimally. Siebel performance can be a little bit tricky, because you don't write the SQL yourself, and you can't actually provide database hints. But when you are writing Search Expressions, you may have more control over the generated SQL than you realize
Workflow Monitor Agent
can be a little confusing in its discussion of Workflow Monitor Agent. If you don't read the Bookshelf chapter carefully, you can come away with the impression that Workflow Monitor Agents must be administered from the command line and dynamically configured.The key to the whole thing, as far as I'm concerned, is the section in the middle of the page that talks about creating "a new workflow monitor agent Component Definition." For several reasons (possibly a future blog topic), it makes sense to split your Workflow Policies into several Workflow Policy Groups. Create as many as you need. For each one, create a separate Workflow Monitor Agent Component Definition. Follow the instructions in Bookshelf.Set the Default Tasks to 1. This allows you to forget everything about administering Workflow Monitor Agent from the command line. The component will start and stop within the graphical interface.Set sleep time to the desired amount. Set up an email address and mail server for automatic notifications, and tweak any other parameters that catch you interest.
Subscribe to:
Posts (Atom)