Pulling MVG Field Value through Scripting
In Accounts > Opportunity, when you create a new opportunity, if Account’s primary contact’s first name and last name should pre-default in opportunity and last Name is a MVG field too then
the following script in Opportunity BC, BusComp_NewRecord can be used to achieve the necessary scenario.
function BusComp_NewRecord ()
{
var AccBO = TheApplication().GetBusObject(“Account”);
var OppBC = AccBO.GetBusComp(“Opportunity”);
var AccBC = AccBO.GetBusComp(“Account”);
var AccId= this.GetFieldValue(“Account Id”);
var ParentBC = this.ParentBusComp();
if (ParentBC != null)
{
if(ParentBC.Name() == “Account”)
{
with(AccBC)
{
ClearToQuery();
SetViewMode(GroupView);
ActivateField(“Account Id”);
ActivateField(“Primary Contact Id”);
SetSearchSpec(“Id”, AccId);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
{
var Cont = AccBC.GetFieldValue(“Primary Contact Id”);
}
}
if (Cont != null)
{
var oMVGBC = this.GetMVGBusComp(“Key Contact Last Name”);
var oAssocBC = oMVGBC.GetAssocBusComp();
with(oAssocBC)
{
ClearToQuery();
SetSearchSpec(“Id”, Cont);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
Associate(NewAfter);
}
oMVGBC.WriteRecord();
}
}
}
}
Read GMT/UTC Time
A simple way to read the GMT/UTC server time is to use a calculated field to read the time as follows:
On the Business Component (BC), create a calculated field – ‘Current Time’ with a calculated Value of ‘Timestamp()’. Set the Type to DTYPE_DATETIME.
The script would read the field like this:
var sDateTime = this.GetFieldValue(‘Current Time’);
For performance reasons, users may want to copy a BC just for this purpose, since the field is recalculated every time a row is read.
rulecache.dat
After assignment rules are created and defined,
you must release them to instruct Assignment Manager to use these rules.
Releasing assignment rules also updates the rulecache.dat file.
rulecache.dat file includes information on employees, positions, and organizations available for assignment.
Exposing more List Columns in List Applets
Scenario: Requirement to expose more List Columns in the List applets.
Solution: For exposing more List columns in List applet we have to change the “count” property in the “For” loop of the CCListBody.swt and CCListHeader.swt files.
We can add any number of List columns in List applet. But for performance and usability reasons, a maximum of 40 list columns should bound to a list applet web template.
Overriding Database Column size for Text fields
Scenario: In certain cases there will be a difference in column sizes between Siebel Database and External Systems which ends up in some confusion in Integration part.
Solution: The field user property, “Text Length Override” uses the field’s Text Length property to define the maximum field length instead of the database column size. The property should have same value as the Text length property of the field in the BC.Use only for Text type fields.
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.
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.
Issues starting Siebel Server on Unix
Scenario: UNIX file system reaches 100% and none of the Siebel services are getting started and starting them results in protection error.
Solution: Clean up the file system by deleting some old logs and core dumps found under SIEBEL_ROOT/log and SIEBEL_ROOT/bin respectively.
Rename the osdf.(gateway name).(enterprise name) file under SIEBEL_ROOT/sys directory.
Rename the (gateway name).(enterprise name).shm file under SIEBEL_ROOT/admin directory.
Start the gateway server followed by the enterprise server; the servers will come up clean with all the protections removed.
Mainwin Core Services
On Unix if you get an error “mainwin core services not started” , try mwadm stop And mwadm start.
This should start the core services.
The assumption is that $MWHOME is set before you try the above commands
When to Create 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