Siebel

Everything you want to know about Siebel !!!

“This” Object Reference

Instead of using TheApplication().ActiveXXX() method, it is recommended that you use the “this” object reference. This is essentially eScript shorthand for the current object of the event handler, rather than the active object. For example, in the BC event handlers, this refers to the BC of the event that the code is placed in. If it is absolutely necessary to use the Activexxx reference at run-time, you must consider the possibility that the script may be executed outside of the UI (e.g. through COM, CORBA or JDB).
Some acceptable uses of ActiveBusObject() include:
• Use in business services to retrieve the current UI context.
• Use on applet level code, although this.BusObject() works just as well.

July 18, 2008 Posted by Narayan Patro | Scripting | | No Comments Yet

Picklist – Long List Property

A number of pick lists that are not based on the List of Values do not have the Long List property defined. Where the property is set to FALSE, Siebel will attempt to position the cursor on the matching row in the pick applet. In the case of Standard Interactive applications, a query will be issued against the picklist BC if the record is editable. This query is performed when the record is displayed.
Consequence: Where the list is long, Siebel will search through the result set to position the cursor resulting in potential performance problems. This is also true where the picklist field does not possess a value.
Recommendation: Set the Long List property of the picklists to TRUE if they will return a large result set (> 30). If this is done, the picklist can no longer be a static picklist and needs to be exposed using a pick applet. Generally only picklists based on LOVs should have the Long List property set to FALSE.

July 18, 2008 Posted by Narayan Patro | Configuration | | 1 Comment

Accessing Objects in eScript

The following table shows how to access the BC or BO objects depending on the object that the event handler or function is in:
Object: Applet/Control
Target Object            Syntax
Current Applet           this.
Current BusComp      this.BusComp( )
Current BusObject     this.BusObject( )

Object: BusComp
Target Object            Syntax
Current BusComp      this.
Current BusObject     this.BusObject( )
PickList BusComp      this.PickListBusComp(…)
Associate BusComp          this.AssociateBusComp(…)
Parent BusComp        this.ParentBusComp( )
MVG BusComp           this.MVGBusComp(…)

July 18, 2008 Posted by Narayan Patro | Scripting | | 2 Comments

eScript Best Practices

I came across a blog posted by Mr. Sridhar on eScript Best Practices. Its quite informative.

You can access the link here.

Thanks Sridhar for collating all the information on your blog.

July 18, 2008 Posted by Narayan Patro | Scripting | | No Comments Yet

Giving Access to another User for Single Object Locking

Problem Description: When Siebel ships its products, the user who has the access to modify the “Allow Object Locking” flag is hard coded in the Business Component and hence the User SADMIN has access to modify this flag. However when we test on Siebel Tools pointing to a Db2 390 where the primary responsibility is with the user QADMIN, this feature is not available or exposed to this user and hence we can’t carry out the operation of modifying the “Allow Object Locking” (AOL) Flag.

Solution: With the help of the following configuration, we can provide access to any user other than the default SADMIN. E.g., please follow the below mentioned steps to give access to QADMIN.

Navigate to Business Component “Repository Project”. Expand it to expose its fields. Query for “OL RO” field. Set the Calculated value for this field to

IIF(LoginName() = “QADMIN”,”N”,”Y”)

Then copy the Siebel.srf file in the tools\Objects\enu folder and compile the changes against the copied file.
Launch Tools connected to the compiled srf. The user should be able to modify the AOL flag now by logging to the Siebel Tools as QADMIN.

July 18, 2008 Posted by Narayan Patro | Configuration | | No Comments Yet

Make Field Read-Only based on View

Step1) Create a calculated field which will be used in BusComp UserProperty (Field Read Only Field: FieldName
Name: ReadOnlyFlag
Calculated: TRUE
Value: GetProfileAttr(“ReadOnly”)

Step 2) Create Field Read Only Field User Property in the BusComp User Proeprty
Name: Field Read Only Field:<FieldName>
Value:ReadOnlyFlag

Step3) Write a script at Application_PreNavigate event where the attribute vaue is set

TheApplication().SetProfileAttr(“ReadOnly”,”N”);

if(ViewName == “<Name of the view for which for which the field has to be made read only>”)
{
TheApplication().SetProfileAttr(“ReadOnly”,”Y”);
}

return(ContinueOperation)

July 18, 2008 Posted by Narayan Patro | Configuration | | No Comments Yet

Organization Enabled LOVs

You can set up LOVs to appear for some organizations but not others.
When LOVs are associated with an organization, the values displayed to the user may differ depending on whether the user is creating a new record or viewing an existing record.

■ If a user is creating a new record, the LOVs associated with the user.s current organization (the organization to which the user.s active position is associated) are displayed. A user can be associated with multiple organizations if they hold multiple positions, but only the organization of the active position determines which LOVs are displayed.
■ If a user is viewing an existing record, the LOVs associated with the record.s owner organization are displayed. For example, the organization associated with a user.s active position may be Org ABC, but the primary  organization associated with the record that the user is viewing could be Org XYZ. In this case, the LOVs displayed for the picklist would be those associated with Org XYZ.

July 18, 2008 Posted by Narayan Patro | Admin | | No Comments Yet

Depth First Search of a Type in Property Set

Scenario: You want to search for a PropertySet in a Hierarchial Data set.

Usual approach: Read the Data set and find out the level of child and then use GetChild(i) function to go to that level.

e.g., var SiebMsg; //Hierarchial Data Set

The structure of the PropertySet SiebMsg looks something like this:
——————————

———————
Start Process Thu Nov 01 22:24:57 2007
Siebel Message in CreateInPS()
PROVIDED PROPERTY SET
Type: Value:
CHILD PROPERTY SET 0
Type: XMLHierarchy Value:
CHILD PROPERTY SET 0
Type: SiebelMessage Value:
MessageId = 3-GFSQS
MessageType = Integration Object
IntObjectName = CC EAI WDS Voluntary Disconnect Request
IntObjectFormat = Siebel Hierarchical
CHILD PROPERTY SET 0
Type: ListOfCcEaiWdsVoluntaryDisconnectRequest Value:
CHILD PROPERTY SET 0
Type: OrderEntry-Orders Value:
CHILD PROPERTY SET 0
Type: Id Value: 3-87VW09
CHILD PROPERTY SET 1
Type: Account Value: 8046900013722350
CHILD PROPERTY SET 2
Type: CCCSGDisconnectDate Value: 04/25/2006 00:00:00
CHILD PROPERTY SET 3
Type: CCCSGOrderType Value: CH
CHILD PROPERTY SET 4
Type: CCCSGReasonCode Value: SB – Siebel
————————Done with PropertySet—————————
Note: This is just an example. Your Siebel Message could look something different with different data. Refer to your sample of data for more processing…

e.g., I need to create a PropertySet from the above Siebel Message which would contain all the child elements of element with Type = “OrderEntry-Orders” as given above.
Typical approach is the following:
If I call the above msg as my input ps then the following we do:

var OrderLvl = Inputs.GetChild(0).GetChild(0).GetChild(0).GetChild(0);

//You can observe the Child levels and their enumeration values “0″ beginning from element with Type = “” i.e. NULL.
Then you can do your processing to retrieve Child elements of “OrderEntry-Orders” type.

There is a problem with the above approach. What if the incoming data set order changes. Your code would fail since you have hard coded the level of OrderEntry-Orders which is served as a reference point for your future processing.

Instead use a method which would work irrespective of data order change in your input. The method does a depth first search of a required / searched type and returns the order.
The method is given below.

The above syntax where we declared and defined a variable to set the order level would look like:

var OrderLvl = findpsType(Inputs, “OrderEntry-Orders”); //This method will retrieve the OrderLvl value correctly even if the order level has changed.

findpsType(ps,type);
var psTemp = null;
var psType = ps.GetType();
if (psType == type) // found
psTemp = ps;
else // try each child until found…
for (
var i = 0,
n = ps.GetChildCount();
i < n && !(psTemp = zzz_psFindChild(ps.GetChild(i)
, type));
i++
);
return(psTemp);

July 18, 2008 Posted by Narayan Patro | Scripting | | No Comments Yet