Anda di halaman 1dari 60

Siebel  Requirements, References & Solutions

Developer’s Reference
Collection by
Amzad Baig
(Amzad.baig@yahooo.com)

Page 1 of 60
Siebel  Requirements, References & Solutions

Table of Contents
Introduction.................................................................................................................................. 4
1.1.Overview................................................................................................................................ 4
1.2.Document purpose................................................................................................................ 4
2.Audience................................................................................................................................... 4
3.Send Email Every 2 Hours – Case Study ................................................................................4
3.1.Requirement.......................................................................................................................... 4
3.2.Assumption............................................................................................................................ 4
3.3.Solution.................................................................................................................................. 4
4.Repeating Component Request Jobs.......................................................................................5
4.1.Example 1.............................................................................................................................. 5
4.2.Requirement:......................................................................................................................... 5
4.3.Solution:................................................................................................................................. 5
4.4.Example 2.............................................................................................................................. 5
4.5.Requirement:......................................................................................................................... 5
4.6.Solution:................................................................................................................................. 5
4.7.Example 3.............................................................................................................................. 5
4.8.Requirement:......................................................................................................................... 5
4.9.Solution:................................................................................................................................. 5
5.How to create an RCR?............................................................................................................ 5
6.How to send mail in Siebel using Communication Outbound Manager?..................................7
7.Siebel Workflow Process – Introduction...................................................................................8
8.How to invoke a Workflow Process?......................................................................................... 9
8.1.Runtime Events..................................................................................................................... 9
8.2.Administration Runtime........................................................................................................ 10
8.3.Scripting............................................................................................................................... 10
8.4.User Property....................................................................................................................... 11
8.5.Workflow Policy................................................................................................................... 11
9.How to Track Workflow Execution?........................................................................................12
10.Siebel Logs - How Useful are they?......................................................................................13
11.How to call a Workflow Asynchronously?.............................................................................15
12.ADM – Introduction............................................................................................................... 18
12.1.How to implement ADM?................................................................................................... 19
12.2.Import/Export..................................................................................................................... 19
12.3.UI Session......................................................................................................................... 20
12.4.Batch Deployment............................................................................................................. 21
12.5.Faqs – ADM....................................................................................................................... 21
13.External Business Component – EBC..................................................................................23
13.1.Limitations.......................................................................................................................... 23
13.2.Advantages........................................................................................................................ 23
14.Siebel EBC VS VBC............................................................................................................. 23
14.1.Base Table......................................................................................................................... 23
14.2.Business Layer VS Database Layer..................................................................................24
14.3.Purpose............................................................................................................................. 24
14.4.Effort.................................................................................................................................. 24
15.How to Create an EBC......................................................................................................... 24
15.1.Getting a DDL File............................................................................................................. 25
15.2.Import DDL file in Siebel Tools..........................................................................................25
15.3.Create the Table................................................................................................................ 25
15.4.Configure the Table........................................................................................................... 26
15.5.Configuring BC and Data source.......................................................................................27
15.6.Creating Business Component.......................................................................................... 27
15.7.Configuring Business Component.....................................................................................27

Page 2 of 60
Siebel  Requirements, References & Solutions

15.8.Creating Data Source........................................................................................................ 27


15.9.Creating an entry in CFG file............................................................................................. 27
15.10.Creating subsystem in Server Configuration....................................................................28
16.Symbolic URL – Integrating Siebel.......................................................................................28
17.List of Values........................................................................................................................ 31
17.1.How to create a new LOV?................................................................................................ 32
17.2.Scenario 1.......................................................................................................................... 33
17.3.Requirement...................................................................................................................... 33
17.4.Solution:............................................................................................................................. 33
17.5.Scenario 2.......................................................................................................................... 33
17.6.Requirement...................................................................................................................... 33
17.7.Solution:............................................................................................................................. 34
18.User Property – Use Literals For Like...................................................................................34
18.1.Purpose:............................................................................................................................ 34
18.2.Usage:............................................................................................................................... 35
19.User Property – Text Length Override..................................................................................36
20.User Property – Required..................................................................................................... 37
21.Siebel Deep Copy-Deep Delete explored.............................................................................38
22.Making Record and Fields Read Only..................................................................................39
23.User Property – Parent Read Only Field..............................................................................40
23.1.Requirement...................................................................................................................... 40
23.2.Solution.............................................................................................................................. 40
24.Client Side Vs Tools Side Business Service.........................................................................41
25.How to configure a Join........................................................................................................ 41
26.Making Search Specification Dynamic..................................................................................44
27.Constraining the PickList...................................................................................................... 45
27.1.Requirement...................................................................................................................... 45
27.2.Solution.............................................................................................................................. 45
28.Adding status indicator to Siebel entities..............................................................................46
29.Workflow made simple - Part I..............................................................................................47
30.Workflow made simple - Part II............................................................................................. 48
31.Using the DefaultFocus Applet User Property......................................................................50
32.siebel.exe switches............................................................................................................... 51
33.How to Automate Siebel Full Compile..................................................................................52
34.Accessing Siebel Repository Information.............................................................................54
34.1.Requirement...................................................................................................................... 54
34.2.Solution.............................................................................................................................. 55
35.Validating an Email Address in Siebel..................................................................................58
35.1.Requirement...................................................................................................................... 58
35.2.Solution without Scripting................................................................................................... 58
35.3.Solution with Scripting....................................................................................................... 58
36.Count (”MVL Link”) - reducing scripting................................................................................59
36.1.Requirement...................................................................................................................... 59
36.2.Solution.............................................................................................................................. 59

Page 3 of 60
Siebel  Requirements, References & Solutions

Introduction
Overview
<<To be written>>.

Document purpose
<<To be written>>.

Audience
This document is intended for use by
 Siebel Business Analysts.
 Siebel Dev. Team.
 Siebel Application Administrator Team.

Send Email Every 2 Hours – Case Study


Requirement
Need to send email every 2 hours to Service Request Owner until the status of
the SR is not changed.

Assumption
While giving the solution below I am assuming that initial status of Service
Request is Open and we need to send the mail until the status is not change from
Open to something else.

Solution
 Create an RCR Job that will run every hour.
 RCR will call a business service that will have following logic
 Query for SR’s with status as Open
 In loop process each SR and evaluate the following condition
While(isSRRecord)
{
CurDate = new Date();
CurTime = CurDate.getTime();
CreatedDate = SRBC.GetFieldValue(“Created”);
CreatedDate = new Date(CreatedDate);
CreatedTime = CreatedDate.getTime();
TotalAge = ( CurTime – CreatedTime) / (1000*60*60)
if (TotalAge > 2)
{
SendEmail to owner
}
} //don’t forget to declare all these variables outside the loop

Page 4 of 60
Siebel  Requirements, References & Solutions

Repeating Component Request Jobs.


Repeating Component Request (RCR) is an essential part of Siebel. They
are generally used to execute batch jobs which you want to execute say once in a
day or once in an hour. Examples below will help you to understand why we need
to use RCR in Siebel

Example 1

Requirement:
Siebel needs to be integrated with external application via MQSeries. External
application will put an XML in the MQSeries queue and Siebel needs to poll
regularly to check if there is an XML file available in the MQ Channel and process it.

Solution:
Create a workflow that will process XML after picking it up from MQ Channel.
Create an RCR job that will be execute this workflow every 5 minutes to check for
an available XML in the queue.

Example 2

Requirement:
Siebel needs to run Fulcrum search functionality available in Siebel. Indexes of
the object on which Fulcrum is going to run are needs to be updated on daily basis.

Solution:
Create an RCR job to run the components on daily basis which will result in
updating of indexes.

Example 3

Requirement:
We need to check if an SR created 2 days from today has been updated or not
and if not then we need to send an email.,

Solution:
Create a workflow to fulfil the requirement and then create an RCR to run this
workflow on daily basis on time where the usage of the application is not very high.

How to create an RCR?


Here is step by step tutorial explaining how to create a Siebel RCR
(Repeating Component Request) Job.

Page 5 of 60
Siebel  Requirements, References & Solutions

 Go to Administration - Server Management > Jobs

 Click on New button in the Screen. Enter the value in the following fields.
 Component/Job: Workflow Process Manager
 Schedule Start: Date/Time when you want you job to start

 Mark the Repeating Checkbox as True


 Repeating Units: Minutes (can be Seconds, Hours, Days, Weeks etc)
 Repeat Interval : 15 ( this time span after which you want your job to
execute repeatedly)
We have given 15 in our case which means the job will repeat every 15
minutes

 In the Job Parameter List Applet Enter Click New button

Name:  “Workflow Process Name”

Value: Test Workflow

 The name of the workflow that you want to execute repeatedly. You can
give more than one workflows for the same job they will be executed one
after another)

 Click on Start and refresh the applet, if the job status goes to Active that
means that you RCR have been successfully deployed.

Page 6 of 60
Siebel  Requirements, References & Solutions

You can check the status of jobs that are executed after repeated interval in the
Repeating Instance Tab.

How to send mail in Siebel using Communication


Outbound Manager?
You need to create a communication profile before you can send mail. To create
a communication profile, please follow the steps given below:
 Go to Administration Communication  Communication Drivers and
Profiles.
 Select Internet SMTP/POP3 Server Profile from List
 Create a New button in Profiles Tab (2nd List Applet). It’s better to copy
an existing profile which is working
 If you are creating a new profile provide following parameters.
 From Address: xyz@company.com (this will be the email address from
which you want to send email).
 SMTP Server: localhost
 Siebel Server: your Siebel server name
After you have created the communication profile you need to create a
business service on client side. You can do that by going to
Administration Business Service » Script
Write the following code to send email
var bs = TheApplication().GetService(”Outbound Communications Manager”);
var inputs = TheApplication().NewPropertySet();
var outputs = TheApplication().NewPropertySet();
var CommProfile = “Name of the Profile you created”;
inputs.SetProperty(”CommProfile”,CommProfile);
inputs.SetProperty(”MsgToList”,”Email addresses to which you want to send mail”);
inputs.SetProperty(”MsgBody”,”Body of email that you want to send”);
inputs.SetProperty(”MsgSubject”,”Email subject”);
bs.InvokeMethod(”SendMessage”,inputs,outputs);
inputs = null;
outputs = null;
bs = null;
Just simulate this business service by going to Administration Business
Service» Simulator.
Type the name of BS and the method that you have created and click on Run.
That will send the mail using from address from the profile that you have created.
So, in this case it will be a mail from xyz@company.com.

Page 7 of 60
Siebel  Requirements, References & Solutions

Siebel Workflow Process – Introduction.


Siebel Workflow is a software tools that lets us automate business processes
with help of workflow processes. Some characteristics of workflow processes are:
 They are created, edited and deployed in Siebel Tools.
 Their changes in workflows are SRF independent though they are
created and deployed in Siebel Tools IDE.
 They are administered through Administration - Business Process Screen
in Siebel Client.
Siebel Tools provides the design interface of Siebel Business Process Designer.
The Mobile Web Client (the run-time client) provides the debugging interface of Siebel
Business Process Designer. After workflow processes are designed and debugged, they
are written to repository tables for deployment from the administrative interface in the
run-time client.
Workflows can be accessed through Object Explorer in Siebel Tools as shown
below:

Workflows can be in 3 types of status:


 In Progress: When you create a new process this is the default state.
In this state you can edit and make changes the workflow process.
 Completed: Workflow process goes into this status after we deploy the
workflow
 Not in Use: Status after we expire the workflow.
There are 3 buttons available to use to change the status of the workflow as
shown in below:

 Deploy: Deploy the workflow and change the status to Completed


 Expire: Expires the workflow and change the status to Not In Use
 Revise: Creates a copy of the workflow with status of the New workflow
as In Progress.
There are various types of workflow processes available
 7.0 Flow: This type is to provide backward compatibility with existing
Siebel 7.0

Page 8 of 60
Siebel  Requirements, References & Solutions

 Long Running Workflows: Workflows that can last for hours, days or
months
 Interactive Flow: Workflow that takes user across Siebel views.
 Service Flow: Executes a set of operations upon even invocation. This
is the most common type of workflow process we created.

How to invoke a Workflow Process?


Workflow is one of the most commonly used functionality in Siebel. They
provide us the way to automate simple and complex business process without
much trouble. Workflows can be invoked in several ways in Siebel.
 Runtime Events
 Scripting
 User Property
 Workflow Policy

Examples of how to invoke workflow process in different ways.

Runtime Events

We can specify runtime event at “Workflow Process” to define a runtime


event in the workflow process, follow the steps given below

Select the connecter after the start step as shown below

In the Workflow Step Branch: window below provide the details at which
you want to this workflow to execute. For example If I want my workflow to be
invoked at write record of Action buscomp then I will enter the following detail

Event Object Type: BusComp


Event Object: Action
Event: Write Record

Page 9 of 60
Siebel  Requirements, References & Solutions

Administration Runtime

Runtime Events are available in Administration - Runtime Event Screen.


We have all the corresponding events which we find in BusComp, Applet and
Application such as WriteRecord, PreWriteRecord, ChangeRecord, and PreQuery
etc. We need to remember one thing here is that Runtime events fire before the
corresponding object event.

For example: WriteRecord runtime event for object type BusComp will fire
before BusComp_WriteRecord event.

To call a workflow from Administration Runtime event define a Action Set


and Enter the information as shown below

Business Service: Workflow Process Manager


Business Service Method: RunProcess
Business Service Context: “ProcessName”, “Name of workflow”

Even Spaces matter in Business Service Context value after there is a space
after comma and then workflow name. Now you can define the event according to
your requirement which will call this Action Set

Scripting

To call a workflow process from scripting you can use the code given below

var svc = TheApplication().GetService(”Workflow Process Manager”);


var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
var rowId = this.GetFieldValue(”Id”);
Input.SetProperty(”ProcessName”, “GEAE Activity Approved by SSD Notification”);
Input.SetProperty(”Object Id”, rowId);
Input.SetProperty(”Opportunity Id”, vOppId);
Input.SetProperty(”OwnerEmailAddress”,v_OwnerEmail);
svc.InvokeMethod(”RunProcess”, Input, Output);

Page 10 of 60
Siebel  Requirements, References & Solutions

Here any property that you set in input property set will be assigned to
corresponding process property in the Workflow Process (WFP) as in the
above example

Input.SetProperty(”Opportunity Id”, vOppId);

above line of code will result in process property called “Opportunity Id” in WFP to
assigned the value of variable vOppId.

User Property
Till Siebel 7.5 the only methods known to invoke workflows were:
 Runtime Events in start step of workflow
 Business Service
 Business Component Script
 Workflow Policies
From Siebel 7.7 onwards there is one more method by which we can invoke a
workflow. That way is Siebel business Component user property. You can “Named
Method n” user property in a BC which can invoke a workflow where n is increment
to the last named method user property defined on that BC.
Name: Named Method n
Value: [Event Name] , “INVOKESVC”, , “Workflow Process Manager”,
“RunProcess”, ‘ProcessName’,[Name of the Workflows] , ‘RowId’, [Row Id Value]
Example: The below mentioned will invoke a workflow named ‘Example Workflow’
when a new record is created in Example BC.
Name: Named Method 1
Value: “New Record”, “INVOKESVC”, “Example”, “Workflow Process Manager”,
“RunProcess”, “‘ProcessName’”, “Example Wrokflow”, “‘RowId’”, “[Id]”

Workflow Policy
Workflow Process can also be called from workflow policy. We can define a
workflow policy (WFP) in Administration – Business Process  Policy.
After you have created a workflow policy record and specified appropriate
conditions, in the argument section choose:
Argument: Process Name
Value: Workflow Process Name

Page 11 of 60
Siebel  Requirements, References & Solutions

How to Track Workflow Execution?


Workflows are the most common term that we come across after Object
Manager. We can achieve really complex functionality through workflows but what
it means is that debugging them is equally complex. We generally test workflows
through Simulation but if we were debug workflows in real time it can be quite
painful and time consuming.
A simple method to debug workflow is to increase the log level for Workflow
Process Manager (WPM) component. But if somebody has ever tried that he can
vouch that it can be quite a headache to go through that log (believe me it is a lot
and it can go up in MB’s even if the workflow is of moderate complexity). And
what’s more is that most of the information that is contained in that log is useless
and not related to workflow functionality.
So here in this article I am going to present a pretty simple technique which
can help you to get just the right amount of information that you need to debug a
workflow.
Instead of increasing the log level of complete WPM component if you just
increase the log level of just selective sub-components that should do the trick. I
will list down the Sub-Components that you need to increase the log level to get
just the appropriate information that you need.
 Workflow Definition Loading
 Workflow Engine Invoked
 Workflow Process Execution
 Workflow Step Execution
 SQL Tracing
Just increase the log level of the above said components from 1 to 4. And to
get logs from dedicated client you need set the Environmental Variable on your
system.
Another approach that can help you in tracking the execution of
workflows and collect various statistics about them. This can be really useful if
you would like to track:
 RCR Workflows
 Workflows executed from runtime
 Workflows executed from Workflow Policy
Steps
 Goto Administration  Business Process  Workflow Deployment 
Active Workflow process List Applet
 Query for the workflow that you want to track
 In the Monitoring level field set the status of the workflow as 1 – Status

Page 12 of 60
Siebel  Requirements, References & Solutions

After you do that there are 2 tables those will contain the information about
that Workflow process.
 WFA_DEFN_LOG
 S_WFA_INST_LOG
You can query in these table to get various type of information such as
execution time, status after execution, the step at which got error out etc. Given
below is a sample query which you can use.
select b.row_id, a.NAME, b.STATUS_CD, a.busobj_name from
siebel.S_WFA_DEFN_LOG a, siebel.S_WFA_INST_LOG b where
b.definition_id = a.row_id and a.deploy_status_cd = 'ACTIVE'
If you want to track a particular workflow then you can modify the query to
the following:
select b.row_id,a.NAME,b.STATUS_CD,a.busobj_name from
siebel.S_WFA_DEFN_LOG a,siebel.S_WFA_INST_LOG b where
b.definition_id = a.row_id and a.deploy_status_cd = 'ACTIVE' and
a.Name = ‘Name of the workflow’
Another way of monitoring the workflows is increasing the monitoring level
in the UI. Go to Administrator  Business Process  Workflow Deployment and
query for the workflow which needs to be monitored and in the bottom applet of
the queried workflow, there is a column called “Monitoring Level” change it to max
4(debug). This captures the process as it goes thru ever step and makes our live
easy in fixing the issue.

Siebel Logs - How Useful are they?


If you have worked on Siebel CRM I am sure that you have heard the term
LOGS lot of times. They are one of the most important and useful things if you are
a Siebel Developer. But still most of us actually know how to use them to our
advantage or to reduce our development time. Here in this Article I will try to
explain some tips and tricks to get the logs and debug our code. Now we all know
that we have two types of Siebel Application Clients.
 Dedicated Client
 Web Client
Siebel Web Client: We will talk first about the Siebel Web Client. Now to get logs
from Siebel Web Client there is no easy way and the only way to get logs is to
increase the log level at server for "Object Manager" or particular component that
you want to get logs of for example Workflow Process Manager. I will talk detail
about the Web Client Logging techniques in my next few posts.

Page 13 of 60
Siebel  Requirements, References & Solutions

Here we discuss ways which can help us get logs from dedicated clients and
speed up our debugging and development time.
Dedicated Client: There are essentially two ways to get logs from dedicated
client.
 Spool
 Environmental Variable
Spool: It is a very basic and known technique to get the spool of all the SQL
Queries that are fired in the database level and we all come across it during our
initial Siebel development days. We can enable the spool for Siebel Client as well
as Siebel Tools. The steps to enable spool for both the Siebel tools and client there
is common process which is as following:
1. Right click the Siebel tools or Siebel Client Shortcut
2. Go to end of String which is in Target Text Field
3. Enter the Following string at the end: /s "c:\spool.txt"
/s switch here stands for Spool. Various other switches that can be used are as
following:
 /u : username
 /p : password
 /d : database
With the following string you can automate login to your local or sample database
depending on the value you give in the switch. I am providing you examples of
both
/u sadmin /p sadmin /d sample: String to login to Sample database with
sadmin user id.
/u user /p pwd /d local: String to login to Local database with "user" user id.
Environmental Variable: This is more powerful and less known method of
generating logs for dedicated client. Siebel has provided couple of Environmental
Variables which are as following:
 SIEBEL_LOG_EVENTS
 SIEBEL_LOG_DIR
SIEBEL_LOG_EVENTS: This environmental variable can have two types of values
numeric or text. The numeric value is the log level which can be between 1-4. 1
being the lowest and 4 being the highest. The Text value can be ALL which means
Log Level of 4.
SIEBEL_LOG_DIR: This value of this variable is path where you want to create
the logs. Makes sure that the path you mention is valid otherwise the logs will be
created in the temp directory.
Examples of both the environmental variables are as following:

Page 14 of 60
Siebel  Requirements, References & Solutions

 SIEBEL_LOG_EVENTS: ALL
 SIEBEL_LOG_DIR: C:\siebel_logs
The process to create these environmental variables is as following:
1. Right click on the My Computer Icon
2. Select Properties from context menu
3. Go to ==> Advanced Tab
4. Click ==> Environmental Variables
5. In User Environmental Variables Tab click New
6. Enter SIEBEL_LOG_EVENTS in Variable Name field
7. Enter ALL in Variable Value Field
8. Click New again and Enter the following details
9. Variable Name : SIEBEL_LOG_DIR ; Variable Value : "your Siebel
log path"
Remember that Variable Names are case Sensitive. After you have created
the variables when you start you dedicated client you will notice that in the path
that you have given a file named siebel.log is created for Dedicated Client and file
named siebel_dev is created for Siebel Tools.
Note: If you don't provide the SIEBEL_LOG_DIR environmental variable the logs
are created by default in Temp Directory.

How to call a Workflow Asynchronously?


This Article is about Siebel CRM 7.X Workflows and Runtime Events. It tells you

how we can use them to our advantage . We all want the response time of our
Application to be as fast as it can and we do everything that we can to achieve
that. I am going to tell you about a way which can help you to reduce the response
time without actually reducing any functionality. Siebel can execute workflows in
two ways.

 Synchronous
 Asynchronous
Synchronous Execution: When workflows are executed synchronously then user
gets the control back only when the workflow has finished it execution.

Asynchronous Execution: When workflows are executed asynchronously then


user gets back the control immediately and the workflow is submitted to workflow
process manager (WPM) as a job to be executed. WPM then executes the job later.

Often we have functionality where large amount of processing needs to be done


on an object which user is not going to use access right now. I can explain it with

Page 15 of 60
Siebel  Requirements, References & Solutions

an example. When user clicks copy button on an opportunity or quote we want


certain custom entities to be copied over but which user will not access at that time
but later. So, we can reduce our response time by just copying the quote or
opportunity synchronously and placing the code of copying of custom entities in
workflow and executing that workflow asynchronously.

There are two way to execute a workflow asynchronously

 Workflow Policy
 Runtime Event and Business Service (BS) Combination
Workflow Policy is pretty traditional method of executing a workflow process.
You create a policy. Enter the conditions. Specify the workflow to be executed.
Generate Triggers. I wouldn't go into details of creating a policy but I will tell you
some disadvantages of using Workflow Policy

1. Slow Execution
2. Difficult to setup
3. Not Reliable and Error Prone
But from Siebel 7.7 onwards we have another more robust, efficient and
quicker way to do that which is Runtime Events and Business Service.

The actual process of Setting up Runtime Event and Business Service assuming
you have working knowledge of both. Just one important thing that you should
know about runtime events is that they are executed even before the Business
Component Events. To explain it better I am taking an example where our
requirement is to execute a workflow when you click Submit Oppty button on
Opportunity Form Applet.

1. Goto Administration  Runtime Events Screen


2. Goto Action Sets View
3. Create a New Record in the Action Set View of Runtime Events
Administration Screen
4. Enter Any Name in the Name Field of the Action Set List Applet
5. Create New Record List Applet Below it
6. Enter
Name = "TestRuntimeEvent"
Action Type = "Business Service"
Sequence = "1"
7. In the Form Applet Below enter the following details
Business Service = "TestBS"

Page 16 of 60
Siebel  Requirements, References & Solutions

Business Service Method = "TestMethod"


8. Click Menu Load Runtime Events make sure that you have
Active Flag checked in both List Applets.
You are done in Action Set View.

Now Goto Events view and Follow the steps given below

1. Click New and enter the following information:

Sequence = 1
Object Type = "Applet"
Object Name = "Opportnity Form Applet"
Event = "InvokeMethod"
Sub Event = "Submit Oppty"
Action Set = "TestRunTimeEvent"
Conditional Expression should be given if you want to restrict the
execution of this Runtime Event to certain conditions and Action Set Name
is always the name of the action set that we created.

2. Click Menu  Reload Runtime Events.

* Everytime you make a change to runtime events you have to Reload


them to activate the changes that you have made.

Now we are through the Runtime Event parts. What we have done so far is
that when user clicks Submit Oppty button it is going to call BS named TestBS with
method as "TestMethod".

Now we are going to write the code in the business service which will
actually result in the execution of Workflow Process Asynchronously.

1. Go To Administration  Business Service.


2. Create a Business Record with name "TestBS"
3. Create a Record in List Applet for Service_PreInvokeMethod and
choose Programming Language as "eScript"
Write the Following code in Code Window inside the function
Service_PreInvokeMethod.

if(MethodName == "TestMethod")
{
var svc;

Page 17 of 60
Siebel  Requirements, References & Solutions

var child;
var input;
var output;
var rowid;
var bo = TheApplication().ActiveBusObject();
var bc = bo.GetBusComp("Opportunity"); // Change the BusComp name with
the name of the BusComp you want to execute the workflow with
svc = TheApplication().GetService("Asynchronous Server Requests"); // Don't
change this - Actual BS that is responsible for submitting a job to WPM
input = TheApplication().NewPropertySet();
child = TheApplication().NewPropertySet();
output = TheApplication().NewPropertySet();
input.SetProperty("Component", "WfProcMgr");
rowid = bc.GetFieldValue("Id");
// We would like to pass the row id of the Current record on which the user is
working - You can pass more than one arguments
child.SetProperty("ProcessName", "Service Agreement - Agreement
Status"); // Workflow process you want to execute
child.SetProperty("RowId", rowid); // passing the values
input.AddChild(child);
svc.InvokeMethod("SubmitRequest", input, output); /// invoking the business
service method
svc = null; // nullfiying the objects
child = null;
output = null;
input = null;
return(CancelOperation);
}

ADM – Introduction.
Application Deployment Manager (ADM) functionality available in Siebel is quite
less known and used but very useful to reduce manual effort of moving various
entities between environments. This post is going to be an introduction about
Application Deployment Manager (ADM). We all (may be not all but most of us) has
been part of Siebel release at one time or the other. Dev2Prod utility provided by
Siebel can automate movement of Repository related data between environments
but it cannot move application related data.

Page 18 of 60
Siebel  Requirements, References & Solutions

By Application related data I mean:

 List of Values
 View
 Responsibilities
 Business Services
 Runtime Events
and many more things.

We have to move them manually and we have to keep track of what we


have changed. ADM provided by Siebel can move them automatically so basically
our task is just to keep the track of what we want to move.

Note: ADM is only recommended if the amount of data that is to be moved is less
otherwise EIM is the preferred option.

There are only few entities that are available in vanilla ADM functionality
that we can move such as LOV, Views, State Model, Assignment Rules etc. but
ADM is not confined to that only we can add customized entities such as Business
services, Runtime Events. You can see ADM related views by going to Site Map 
Application Deployment Manager

How to implement ADM?

There are 3 different ways to implement ADM:

 Import/Export
 UI Session
 Batch Deployment

Import/Export

This is the simplest of them all, what you need to do is just:

 Create an ADM Project


 Add entities that you want to move.
 Apply appropriate Filter
 Export them in File
 In the target environment Import that file

and you are done.

Page 19 of 60
Siebel  Requirements, References & Solutions

But it is easier said than done. So, here are some points that you need to keep in
mind.

1. There should be a shared folder that should be accessible from


both Source and Target environments.
2. Don’t forget to check the Export to File checkbox
3. If your servers are on Unix/Solaris environment then you need
to provide path according to that ex: /opt/shared/ and if your servers
are on windows then you need to provide path like
\\servername\sharedfoldername
4. Path provided in Source environment should be only till the
shared folder. Example: If you want that your file should go to
/opt/shared/admfolder then you should give the path as
/opt/shared/admfolder/.
5. In the Target environment you will provide complete the path
including the filename that you want to import.

UI Session

This process is very simple to execute but a bit tricky to implement. In this
process you

 Go to Application Deployment Manager  Deployment Projects


 Create a Project
 Add entities and apply appropriate Filter
 Enable the project
 Deploy the project

and you are done.

Things to keep in mind:

You need to Activate some workflows before it starts working. 

Go to Administration – Business Process  Workflow Deployment.


Query for UDA* and you should get list of 9 workflows activate them all and make
sure they are activated on target environment also.

Page 20 of 60
Siebel  Requirements, References & Solutions

And it should work well after that.

Batch Deployment

This approach is least preferred and never explored into detail but just to
give you the overview. You can run an ADM job from command line.

Pre-requisites are that you need to modify couple of workflows and there
should a shared folder accessible to both source and target environments. If you
want more details about this method the please go through bookshelf.

Faqs – ADM

Question: What are the limitations of ADM? What it can move and what it can not?

Answer: Theoretically it can move any kind of entities but all the entities are not
available OOB (Out of Box).  But you can create Integration Object for any entity
and use it for ADM.

Question: What is the interface? Can it run for all data types (Database type,
repository type & file type) via command prompt without any manual intervention?
What needs to be done additionally?

Answer: ADM can be run form Siebel Application and Command Prompt both. In
Siebel 8.0, ADM can be use to transfer Application Data, Repository Data and also
for SWT and SRF files but in Siebel 7.x File Type (SRF and SWT) can be transfered
through ADM.

To run it successfully from command prompt you need to modify some workflows
and need to activate some workflows in case you are going to run it from
Application. In addition to that there should EAI Object manager available on
Target System. Complete steps are available in bookshelf of running it through
application and command prompt.

Question: How ADM takes care of delta after it is run once?

Answer: I am not quite sure about this but It uses Integration object and EAI
Siebel Adapter “Upsert” method so if you know how it works then you have your
answer. If not then here is an overview. Upsert method never results in deletion of

Page 21 of 60
Siebel  Requirements, References & Solutions

records it queries for record based on User key and update if record is found it
updates otherwise it inserts the record.

Question: What happens if DB goes down while ADM is running? Will it rollback or
it will maintain a state and restart after DB comes back?

Answer: Yes, it has a rollback option in Siebel 8.0 but I am not sure about Siebel
7.x but I think it uses EAI Siebel Adapter so ideally the transaction will be reverted
back if it doesn’t complete.

In Siebel 8.0 you need to mention if it should backup the data or not. If you choose
yes then it will take care of reverting back in case if an error occurs in between the
process.

Question: Can I stop ADM in between and start again? I have seen we can start it
again, but does it maintain the state? If yes, how does it maintain it?

Answer: No, I don’t think we can stop and start it at our will.

Question: I have read that it backs up the data in the target environment before
deploying & activating. How does it take the backup and what does it take the
backup?

Answer: Yes, it does backup in Siebel 8.0 if you specify and it takes backup in
form of XML files. The process is:

 Data is queried through EAI Siebel Adapter


 An XML is prepared that goes to target system
 Using EAI Siebel Adapter “Upsert” method on target system it is inserted
into target system.
When you say that backup data, that XML is saved in a file and used to revert back
in case need be.

Question: What is the effort to configure ADM and run it in development


environment?

Answer: OOB of box ADM is just activating some workflows and follow steps given
in bookshelf. But if you want certain custom entities to be added then effort can
increase.

Question: What are the size requirements for running ADM?

Answer: By size I assume that you are asking how much data can be transferred. 
Well I don’t have an exact figure but I think I read somewhere that if exported
data should not exceed 4 MB. So to make sure that you are in limit you can export
the XML file and see it is adheres to 4 MB limit. But it will better to ask Siebel for
an exact figure.

Question: How and where do we write scripts to customize it?

Answer: I don’t think you need to write scripts to customize it. It is as simple as
creating an IO for your customized entity and use it.

Page 22 of 60
External Business Component – EBC
External Business Component (EBC) is another way of integrating
Siebel with External Applications. It is another tool available at your disposal to
achieve integration. EBC is an easy and robust way to integrate Siebel. Here is
how it works:

 You get a DDL of a table located in external database.


 Import that into Siebel tools and a table is created in Siebel pointing
to external table.
 You create a data source to connect to external database.
Then you do the usual configuration of creating a BC, BO, View and Applets based
on that Table.

When you access that view, Siebel in real-time using that data source
connects to external table and displays you the data. You even have option to
update, insert and delete records from Siebel.

Limitations
1. If you import a database view instead of DDL then you cannot
update or insert records.
2. Joins to base tables in EBC usually don’t work.
3. External database must be accessible directly to Siebel.
4. Performance can be an issue if database connectivity is not
good.

Advantages
1. You can integrate with external application with minimal of effort.
2. Siebel BC can base joins on External table and display
information.
3. You can import tables from different databases such as DB2, MS
SQL, Siebel Analytics.
You can read more about EBC in Siebel Bookshelf.

Siebel EBC VS VBC


Base Table
 EBC: EBC is based on external table and uses data source defined on BC
and Table to retrieve data
 VBC: VBC has no base table and it is based on special class. It uses a
Business Service to retrieve data.
Business Layer VS Database Layer
 EBC: While creating EBC you import external table definition into Siebel
which results in a proxy table being created in Siebel which points to
external table so we can say that EBC integrates Siebel to external
applications at Database Layer
 VBC: No table is involved in creation of a VBC and we need to use either
Vanilla BS such as XML Gateway service or custom BS that will retrieve
data through Siebel Business Layer

Purpose
 EBC: The purpose of an EBC is to view, update, insert and delete data
available in external database. It is always used to integrate with
external applications
 VBC: The purpose of VBC is usually to view external data that we don’t
want to store in Siebel. It is not necessary to use VBC only for
integration. For example If I want to view Product Configurator
information in typical Siebel Applets and Views then I can use VBC to
achive this.

Effort
 EBC: It is very easy to create and configure EBC. You just need to
import external tabe definition and after that you can use usual Siebel
Configuration techniques and create BC, Applets and Views based on
EBC without any difficulty
 VBC: You have to write script for handling each and every event that
you want your VBC to support such as Query, Insert and Init etc. So, I
would say effort required is greater in VBC

How to Create an EBC


Below are the steps that are needed to perform to create EBC

 Get an DDL file for an external table


 Import DDL file in Siebel Tools
 Configure the newly created table
 Create an Business Component based on this table
 Configure this Business Component

After that you can use this BC just like any other Siebel BC with some
limitations.
Getting a DDL File

Table used in this example is oracle database table and you can get
DDL of oracle database using Toad or SQL Developer any tool provided by
oracle to interact with database.

Steps required to do to get Table DDL using SQL Developer:

 Open SQL Developer and connect to database in which you table


resides.
 Select the table for which you want to get DDL file
 On the right hand side you will see various tabs as shown below picture.

 Click on SQL Tab.


 You will see the DDL of that table in the window below.

 Copy and Paste it in .txt file and save that file.

Import DDL file in Siebel Tools

Create the Table

Steps required for creating and configuring the table in Siebel Tools:

 Open Siebel Tools.


 Click on File  New Object.
 Select External Table Schema Import object.
 Provide the relevant information in the Table Schema Import Wizard as
shown below.

Configure the Table


 Select the Data Source object of newly created table.

 
 Create a new record in Data Sources List applet.
 Provide the name of data source that you will use to connect to this
table.
 Select the column object of this table and query for ROW_ID in Alias
Field.
 In System Field Mapping select the Id value from dropdown (This is
the only mapping that is mandatory but you can map different
system fields also).

 After mapping your field should appear like this.


Configuring BC and Data source

Creating Business Component

Steps to create business component are same as creating any other


business component. You can create it through Business Component wizard and
choose the table created in previous steps.

Configuring Business Component

There are two important things that you will need to do this BC for it to
work.

 Uncheck the Log Changes property for this BC

 Provide Data Source Name in Data Source Field

Once you configure these details then you can use this BC in your
configuration just like any other BC. You can base your Applets on this BC and
create Views.

And the configuration in the Siebel tools is now over. There is just one more
thing that you need to do, to make all this work.

Creating Data Source


 Create a data source (with same name as you have specified in table
and BC) that will connect to external database.
 You need to create an entry of this newly created data source in your
CFG file for dedicated client to work and you need to create subsystem
in Server Configuration for thin client to work.

Creating an entry in CFG file


 Open your client CFG file.
 Copy and paste details of your [ServerDataSrc] section in CFG
 Rename this data source to the name that you have mentioned in tools.
(As in example your data source entry name is ContactEBC. So,
your new section will start from [ContactEBC] as shown below).

Now your EBC is ready to work through dedicated client.

Creating subsystem in Server Configuration.


Navigate to Administration - Server Configuration > Enterprises >
Component Definitions.

In the Component Definitions list applet, select your Application Object Manager
Component.
For example, select the Call Center Object Manager (ENU).
Choose Start Reconfiguration from the Menu drop-down list on the Component
Definitions list applet. The Definition State of the component will be set to
Reconfiguring. Reselect your application component after selecting the Start
Reconfiguring menu item.
 
In the Component Parameters list applet, query for OM - Named Data Source
name, and update the Value by adding the alias name of the data source specified
in the “To configure the data source definition” section. The format of the OM -
Named Data Source name parameter is a comma-delimited list of data
source aliases. It is recommended that you do not modify the default values, and
that you add their new data sources to the pre-existing list.
 
After the parameter values are reconfigured, commit the new configuration by
selecting Commit Reconfiguration from the Menu drop-down list on the Component
Definitions list applet.
 
The new parameter values are merged at the enterprise level.
 
To cancel the reconfiguration before it has been committed, select Cancel
Reconfiguration from the Menu drop-down list on the Component Definitions list
applet.
 
To configure the data source definition
 
Navigate to Administration - Server Configuration > Enterprises > Profile Configuration.
 
Copy an existing InfraDatasources named subsystem type.
 
Change the Profile and Alias properties to the Data Source name configured in Siebel Tools.
 
Update the profile parameters to correspond to the external RDBMS:

DSConnectString = Siebel_EBC (This is the data source created in ODBC32 –Machine


Datasource)
 
For the Microsoft SQL Server or the IBM DB2 databases, create an ODBC or equivalent
connection and input the name of this in the parameter.
  
DSSSQLStyle = MSSqlServer
DSDLLName = sscdms80.dll  (For SQL Server)
DSTableOwner = Siebel_EBC
DSUsername = sa
DSPassword = sa

Symbolic URL – Integrating Siebel


This is a relatively lesser known way of integrating Siebel with external
applications and it is quite different than other methods available. Symbolic URL’s
enable you to actually open external application inside Siebel Applets. For
example it is possible for me to create a screen named Google Search in Siebel
and see the site inside Siebel application and we will do then when we get to
hands on.
Most common use of Symbolic URL’s is to see Siebel Analytics Reports
inside Siebel CRM application and it is used majorly in portal applications to
display contents of external application.
There is no formal definition for Symbolic URL that I have come across but
is quite effective and a novel way to integrate Siebel with external applications.
That’s enough of theory and now is the time for some practical. Here is a
step by step tutorial on “How to configure Symbolic URL in Siebel?” and what
will try to achieve is a new have a new Screen in Siebel that says Google Search
and when we click on it we should be able to see Google in it.
The first thing that we need to do is define a Symbolic URL pointing to the
website.
 Go to Administration Integration  WI Symbolic URL List view
 Click on Dropdown in list applet and select Host Administration
 Create a new host record and enter the following detail:
Name: google.com
Virtual Name: GoogleSearch

 Click on the dropdown in List Applet and Select Symbolic URL


Administration

 Create a new Symbolic URL Record and enter following details:


Name: GoogleSearch
URL: http://www.google.com
Host Name: google.com [Name you had given in first Step]
Fixup Name: Default [Determines how URL appears in the App.]
SSO Disposition: IFrame

 As we just want to see static site so will not provide any arguments.
Now our Symbolic URL is ready let us go to Siebel tools to do required
configuration to display it in GoogleSearch Screen.
 Go to Business Component that you will base your applet upon. In
this example we use Account.
 Create a new calculated field and provide the following detail:
Name: GoogleSearch
Calculated: True
Calculated Value: “GoogleSearch” [Name of the Symbolic URL we
just created and don’t forget to put quotes around it]

Now we need to expose this on UI in an Applet. You can create a new


Applet based on Account BO and expose just one field in that applet or you can
copy an existing Applet such as “SSO Analytics Administration Applet” that is
already configured with Symbolic URL and modify it to contain our newly created
Symbolic URL. As I am doing in this example:
 Query for “SSO Analytics Administration Applet” under Applet Object.
 Copy this Record and provide following detail:
Name: GoogleSearch
Business Component: Account
Title: Google Search

 Now go to list column section of this field and provide following details
for a lone record that is available
Name: GoogleSearch
Field: GoogleSearch
Field Retrieval Type: Symbolic URL

Don’t forget to expose this field in Applet Web Layout and make
sure you expose it in base mode.
Now let’s create a view that will have our applet. Again here you can use
Wizard to create a new view or just copy existing Analytics View.
The Web Template of the new view should be “Analytics View”.
 Copy an existing view “SSO Analytics Administration View” and provide
the following details:
Name: GoogleSearch
Business Object: Account
Visibility Applet: GoogleSearch
 In View Web Template Item object give the following details:
Name: GoogleSearch
Applet: GoogleSearch
Applet Mode: Base

The final step is to create a Screen which will contain this view.
- Add that screen to your Application
- Register the view in Application.
Compile the View, BC, Application, Screen, Applet objects that you just created or
modified and the final result that you will get is shown below.

List of Values
List of Values (LOV) is assumed to pretty simple entity in Siebel and having
very limited use, of showing values in dropdown picklist. But, they can be used in
more than one ways. They can be a real life saver. One use of them is to avoid
hard coding. Yes, you can avoid hard coding of values and use LOV instead which
you can then change without SRF Release.
How to create a new LOV?
You can create an LOV from two places both have a different way of
creating LOV in Siebel CRM.
 Administration – Data  List of Values
 Administration – Data  LOV Explorer
Through List of Values to add a new LOV following steps have to be
followed. As an Example we will add a new LOV for Martial Status of a person.
1. Click New and choose LOV_TYPE in Type field.
2. Enter MARITAL_LOV in ‘Display Value’.
3. Enter ‘Marital Status’ in Language-Independent Code field.
4. Enter ‘English-American’ if you implementation language is English
otherwise it will be according to the language of your
implementation. Save the record.
5. Click New again and choose ‘MARITAL_LOV’ in Type field.
6. Enter ‘Married’ in Display Value and Language-Independent
Code field.
7. Enter ‘English-American’ if you implementation language is English
otherwise it will be according to the language of your
implementation. Save the record.
8. Follow steps 5 -7 for all values that you want to associate with this
LOV.
For example we will follow steps 5 - 7 and just change the value Married to
Single so that it can have two values ‘Married’ and ‘Single’.
Through LOV Explorer you have to perform the following steps.
1. Click New and enter ‘MARITAL_LOV’ in the Type field.
2. Click on the + sign in the left hand side of the LOV Explorer pane
for the type that you created.
3. Click on the Values folder.
4. In the Right hand side Applet click on New.
5. Enter ‘Married’ in the ‘Code’ and ‘Display Value’ field.
6. Enter ‘English-American’ if you implementation language is English
otherwise it will be according to the language of your
implementation. Save the record.
7. Repeat steps 4-6 for the all the values that you want to enter.
That’s it. You are done with creating the New LOV with new Values
To enter New Values in the existing Siebel LOV just perform the
following steps.
1. Query for the LOV Type that you want to add New values.
2. Copy the record Enter the Display Value and Language
Independent Code field.
3. Change the value in the Order Field to be the unique number and
save the record.
Here are some real scenarios where List of Values are used to accomplish
task which otherwise would have a real pain while moving stuff different
environments.

Scenario 1

Requirement
We were creating workflows that were going to integrate Siebel with some
other application with the help of MQ Series. Now, to accomplish that we had to
enter two parameters related to MQ Series in the first step of workflows, Queue
Manager and Physical Queue Name. If, we were to hardcode then it would be
difficult to move workflow between different environments such as QA and
production because they had different Physical Queue Name.

Solution:
There LOV’s came to our Rescue. We created two LOV’s with the values of
the Queue Manager and Queue Name and used LookupValue() method in
workflows to accomplish that. LookupValue() method accepts two arguments
‘LOV Type’ and Language Independent Code (’LIC’) and returns the display value of
that LOV Type. The syntax is as following:
LookupValue(”LOV Type”,”LIC”)
Example:
 Create a new LOV Type (like MQ_PHY_QUEUE_NAME. It should be same
in all the environments where you want to deploy the workflow).
 Enter the Display Value (actual value that you want to specify like
SIEDEV1 for dev environment and SIEBQA for QA environment).
 Enter the LIC (can be anything descriptive like ‘Physical Queue Name’).
 In the Input Arguments of workflow choose input argument type as
Expression and specify the value as follows:
LookupValue(”MQ_PHY_QUEUE_NAME”,”Physical Queue Name”)
Now, it is going to pick the value as ‘Display Value’ of the LOV specified.

Scenario 2

Requirement
Siebel Service Request module was to be implemented because of a new
implementation the business requirements were being changed all the time. One
Strange requirement was to make the Required Fields of a business component
dynamic. So that they can be changed without a release. Now, we all know one
way to make a field required is to set the Required Property of the field to true.
But that would mean that if I were to change that a new SRF deployment will be
required.

Solution:
LOV’s again were the life saver here. We created an LOV called
SRV_REQ_FIELD and in the Display value we provided the names of the fields that
we wanted as Required Fields. In the Business Component Pre_WriteRecord event
we queried for that particular LOV and traversed through the records that were
active. If the Field provided in the LOV did not contained a value then an error was
raise stating that the value for that particular required field was not supplied. Given
below the Pseudo Code for the script might look like
BOLOV = TheApplication().GetBusObject(”List Of Values”);
BCLOV = BOLOV.GetBusComp(”List Of Values”);
with (BCLOV)
{
Query for LOV Type as ‘SR_REQ_FIELD’ and Active Flag = ‘Y’
}
IsRecord = BCLOV.FirstRecord();
while( Last record is not reached)
{
this.ActivateField(BCLOV.GetFieldValue(”Name”));
if ( this.GetFieldValue(BCLOV.GetFieldValue(”Name”)) == “” )
Raise Errro Text (”Value not given”)
BCLOV.NextRecord();
}
This solution is not recommended if the number of fields that are
required is fairly large. But still can be really handy in many situations.

User Property – Use Literals For Like


Purpose:
If you have gone through logs sometime then you might have noticed that if
you query with a text in a field then the query generated at backend has lot of like
clauses which queries with all the permutations and combinations for that text. For
example if I query on the Last Name Field with “SADMIN” in application the query
generated at backend might have clause as shown below:
((T11.LAST_NAME LIKE :2 OR T11.LAST_NAME LIKE :3 OR T11.LAST_NAME
LIKE :4 OR T11.LAST_NAME LIKE :5) AND UPPER(T11.LAST_NAME) =
UPPER(:6))
And the bind variables will have values like
 2:= ‘sa%’
 3:= ‘Sa%’
 4: = ’sA%’
 5:= ‘SA%’
 6:= ‘SADMIN’
Now, this can lead to performance issues in cases if the query is done on
long fields such as Comments or Description field in Service Request BC. In that
case using this user property might help. If you use this user property on a
particular field then for that field bind variables will not be used, it will be
replaced by the values directly.

Usage:
It is a field level user property. Follow the steps given below to define
this property.
 Open Siebel Tools and query for the BC which contains the field on
which you want to define the user property.
 Query for the Field.
 Click on the + sign on Field Object in Object Explorer.
 Select Field User Property Object.

 In the Field User Property List Applet create a New Record and provide
following detail:
Name: Use Literals For Like
Value: TRUE
And you are done. After you do that the query generated on backend will
not use bind variables for this particular column and your query will look like
(T11.LAST_NAME LIKE ‘SADMIN%’)
User Property – Text Length Override
Lot of time we have requirement which involves restricting user input to
certain length. Most common way to do that is to specify the Text Length
property of the field. I used to do that until recently when I came to know that
even after specifying field length user was able to enter more than the allowed
limit.
Going through the bookshelf I read a note which said

“Text Length property is usually ignored and the length is retrieved from the
underlying column definition”

So, that in effect means that whatever is the column length at the
database level is limit at the BC level too. But that is not what we wanted so
after further exploration we came across a user property that could help us to
limit length without modifying the column at database level.

 Text Length Override

Text Length Override and it can have a value as TRUE which means
enforce the Text Length field property or it can have a different value such as 10
or 20 which means that will become the new limit.
Here is a step by step procedure on how to use this user property.
 Query for the BC in which the desired field is present.
 Select the field on which you want to enforce the limit.
 In object explorer click on the + sign against field and select User Property option
as shown below:

 Create a new record in the Field User Property area.


 Enter the following information
Name: Text Length Override
Value: TRUE
OR
Name: Text Length Override
Value: 10
Where the number is the limit that you want to enforce and you are done.
Compile and see the changes.
Note: This user property can only be used with text type fields.

User Property – Required


Making a field required is very common requirement and making a field
required on conditional basis is also not unusual.
Making field required is very simple by just checking the Required
Property of the field. But making field required on conditional basis is a bit tricky.
There are couple of alternatives to that.
Scripting: I have already explained one approach in the Post to make
Required field SRF Independent using LOV’s and Scripting.

User Property: You can also use User Property called ‘Required’ to make a field
required on conditional basis.

There is only one limitation of this user property that the class of the BC should be
either CSSBCBase or inherited from CSSBCBase
 

Syntax: Required

Value: Expression if evaluated as Y will result in the Field becoming Required.

Procedure:

 Select the field of the BC which you want to make required.


 Select the Field User Property as shown in the Picture below.

 Create a New User Property.


 Enter the Name as Required.
 Put the value as Expression.

Example:

We Assume that we want to make Field called Full Name to be required if Name Flag
Field is Y. So you user property will be like below.
Name                               Value
Required                IIf ([Name] = “Y”, “Y”, “N”)

Siebel Deep Copy-Deep Delete explored.


Often we have requirement where we would like more than one child to be copied when the
parent record is copied and similarly when we delete the parent records its child records are
also deleted. There are couple of user properties that have been provided to us which can help
us to accomplish that without using scripting.

 Deep Copy n
 Deep Delete n

Deep Copy n:

Syntax:
Name : Deep Copy n
Value : Child Business Component Name

I will try to explain this with example.

Normally when you click copy button of Quote only Quote is copied. None of its child
records are copied.Our requirement is to copy Quote item, quote attachment and
Order (Child BC of Quote)  when we copy Quote record then we can make use Deep
Copy user property. Now to implement our requirement we will have to follow the
steps given below:

1. On Quote BC create 3 Deep Copy user properties

Deep Copy 1  Quote Item


Deep Copy 2  Quote Item Attachment
Deep Copy 3  Order
*Value of Deep Copy user property is the name of the Child business component that
you want to copy.

2.  Add a multivalue link in the parent business component for each child business
component.
3. Create a multivalue field in the parent business component from each child business
component specifying the multivalue link to use.
4. Set the No Copy property of that multivalue link to TRUE

Deep Delete n

Syntax:
Name: Deep Delete n
Value: Child Business Component Name
If we continue with the above example then we would want to delete these children also
when we delete the quote record.
To accomplish that we would follow the following steps

1. Create 3 Deep Delete user properties on Quote BC


 Deep Delete 1  Quote Item
 Deep Delete 2  Quote Item Attachment
 Deep Delete 3  Order

2. Set the No Delete Property for the Multivalue links to TRUE

Yes, I know it is a bit confusing.  I will repeat once again

Setting No Copy to TRUE will allow you copy child BC with Deep Copy user
property and setting No Delete to TRUE will allow to delete child BC with the help of
Deep delete User Property.

Making Record and Fields Read Only


A pretty common requirement is to make a specific field or a record read only. In this
post I will describe various ways to accomplish that in siebel

Making the Field Read only on UI

 Set the Read only property on applet object to true for that field. 

Making the Field Read only on Business Component

 Set the Read Only property of that field to true. (But this property is rarely used and
doesn’t make any sense to create a field and then to make it read only… anybody any
pointers)
 Field Read Only Field: fieldname user property is used to make the field read only

Syntax:
Property Name
Field Read Only Field: Status

Value
Status Flag

In this user property value is a name of field 


If the value of the status flag (field name) is True then Status will become read only
and if the Status Flag is false then this field will be editable.

Making the Business Component record Read only

 BC Read only Field user property is used to make the BC Record Read only.

Syntax:
Property Name
BC Read Only Field

Value
Status

Here value is the name of the field that will determine whether the Record will become
read only or not. If the value of the field specified is evaluated to true then Record will
be read only otherwise editatble.

User Property – Parent Read Only Field


Requirement
We were trying to trying change the status of Quote and Quote Item through Asynchronous
workflow. We queried for quote made it active and then changed the status to ‘Priced’ and then
we had to change the status of Quote Item to ‘Priced’ and then again make the quote inactive.

Problem:

After changing the Quote status to ‘Priced’ when we tried to change the status of
Quote Item to ‘Priced’ we received an error

‘Status is a read only field’

There was no Field Read Only Field: [fieldname] or BC Read Only Field which could
result in making that record or that field read only .

Reason:

After struggling for few hours we saw another user property called ‘Parent Read Only
Field’ which had a value something like this

Parent Read Only Field : Quote.Status Lock

Status Lock was a calculated field in Quote which had a value

IIF([status] = “Priced”,”Y”,”N”)

After going through bookshelf we found out that this user property will make the
child record read only based on the value in Parent Record.

Solution

To overcome this problem we changed the quote item status first and then the quote
status ( Pretty Simple Isn’t it)

Few noteworthy things about this user property are:


 The Field that is being evaluated should have its link specification property set to true
otherwise it is not going to work
 The syntax of the value of this user property should be Buscomp.Field where
buscomp is the name of the parent buscomp and Field is the name of the field that
should be evaluated.
 The business component which contains the field that is to be evaluated should be the
parent or grandparent by way of link or series of link relationships

Client Side Vs Tools Side Business Service.


In Siebel we can write business services in two places.

 Siebel Client
 Siebel Tools

There is nothing different in the scripting that we do but there are differences in how
these business services are executed.

As far my knowledge (which is pretty limited ) is concerned the difference between


them are as following.

 Client side is SRF independent and Tools is SRF dependent (Which means an SRF
change is required even if we want to make a slight change)
 Siebel Client BS Compiled at Runtime and Siebel Tools BS is compiled when we
compile the SRF

When you have to make decision of writing a Business Service following factors can
affect your decision.

Performance: Tools BS has slight advantage of Performance (Theoretically) as it is


compiled before hand and just executed at run time.

Flexibility: Client BS offers you ultimate flexibility as you can change the code
anytime you want to. So, if flexibility is more important to you then Client BS is for
you.

IDE: From developers perspective Tools BS provides you better IDE and better syntax
checking. Client Side BS has a crappy IDE and zilch syntax checking,just a field where
we write the code.(I have spent hours debugging Client Side BS just to find out that I
had misspelled a variable name )

But still I have not come across even a single solid point that can help us to determine
exactly when we should use Client Side BS or Tools Side BS. It mostly depends on
developer’s choice who is writing the BS. So, I am leaving this post as an open
question asking you all about your inputs which can help us to take right decision as
right time.

How to configure a Join


There are two types of commonly used joins
 Implicit Join 
 Explicit Join

Implicit Join: - Implicit Join are those which are already define in Siebel and which
are internally use by the Siebel to pull the values from the other than base table.

example: - join between base table and extension table like S_OPTY and S_OPTY_X
and join between S_PARTY and S_ORG_EXT 

Explicit Joints: - Explicit Joints are those which are define by the developer to create
the relationship between two tables.

Let’s take a real life example to understand the concept of Joins better.

We have one table of the Employee where Name, Employee Id and other information
about the employee is stored.
Another table stores a list of Cities.

Requirement is to know which user stays in which city. There are two ways to do it

 Store city in the Employee table which will result in data redundancy.
 Store Primary key of city table in the employee table and pull the values at the run time,
which is more efficient and makes more sense.

To implement second approach we use joins in Siebel.

You have to follow the following five steps to have joined field on UI in Siebel

1. Identify the column to be used as Foreign key.


2. Configure field which will store the primary key of join table.
3. Configure a join.
4. Configure join specification.
5. Add a field which will be used at Applet.

An example will make things more clear.

Suppose we want to have Opportunity Name on the Quote Applet. Here is a step by
step procedure with screen shots explaining how to do that.

1. Identification of Column to act as foreign key.

To configure a Join, first of all we have to find out a column in the base table where we
can store primary key say (ROW_ID) of opportunity in quote which will become the
basis of join.

If there is no column vacant in the base table we can use extension table for that base
table  e.g S_DOC_QUOTE_X for the S_DOC_QUOTE.

Note: Make sure that the column you choose is not being used by any other BC or
any other field of same BC.
2. Configure Field in Business Component

 Go to Business Component > Field


 Create a new record
 Enter the name of the field.
 Enter extension table name in Join field if the column you identified belongs to
extension table otherwise go to step 5
 Select the Column identified in column Field.

Note: The column which you have selected must have physical Type varchar.

Our Foreign key is now ready for use. Now we have to configure a joined Field which
will use this foreign key

3. Configure/Create a Join

 Go to Business Component > Join


 Create new record.
 Give name of the table with which you want create join ( S_OPTY in our case)
 Give Name in Alias (New in our case).
 Check the Outer join Flag (Very Important).

Go to Object List Explorer (OBLE) on the left hand side and click + sign beside join
there will be two options Join Specification and Join Constraints

4. Configure Join Specification

 Create New Record.


 Give Name in the Name field.
 Destination Column is given by default when insert a new record. You can change it if
you want to.
 In the Source field give the name of the source field (OptyID) which you have
configured earlier to be used as Foreign Key.

5. Configure the field (Opportunity Name) which you want to display on the User
Interface.

 Go to Business Component > Field


 Insert New Record
 Give Name in the Name Field
 Enter the Join Alias which you have given for the join you created.
 Select the Name (for Opportunity Name) in the column field. Column name here
represent the data that you want to pull from opportunity.
 
6. Configure the Control in the Applet (UI).

 Go to Applet > Control (if Form Applet)


 Go to Applet > List > List Column (if List Applet)
 Create New Record.
 Enter the Name
 Enter the name you want to display on UI in Caption Override Field
 Enter the Name of the field you created in Field column

Don’t forget to map this field in Applet. Right Click on the corresponding Applet and
map it.

Now compile the entire project which you have made the changes and you will be able
to see this joined field in the Quote Applet as shown in the picture below.

When you see this field in User Interface it will be read only because when the data is
pull from the join table it is only read only, to make it editable you have configure Pick
Applet on this field.

Will include the procudure to make it editable in next post.

Making Search Specification Dynamic.


I think we all know what search specification means in Siebel. But just for
introduction purposes I would like to give an overview.

Search Specification is criteria that we can apply on an Siebel object to restrict the
amount of data that reaches the user.

You can apply search specification on objects like BC, Applet, Picklists etc.

Search Specification becomes a part of where clause when the query is executed on the
database hence only those records are brought back those satisfy the criteria.
For quite a considerable time I thought Search Specification can only be static, meaning once
you give the criteria on a particular object then you need change SRF in order to make a
change in that. But I was wrong, we can have a dynamic search spec too but that can result in
performance impact.

How to make search spec dynamic?

We can use

 LookupValue function
 GetProfileAttr function

Above said two functions can help us to create a dynamic search spec.

I will give some search specs as example to show their usage.

 [Activity Id]  = GetProfileAttr(”ActId”)


 [Name] LIKE GetProfileAttr(”NameofUser”)
 ([Lead PNL] = GetProfileAttr(’LeadPnlConstrain1′) OR [Lead PNL] =
GetProfileAttr(’LeadPnlConstrain2′)) AND ([Contractor Flag]<>’Y')
 [Sales Tool Type] = LookupValue (’SALES_TOOL_TYPE’, ‘Component’)
 (([Sales Tool Type] = LookupValue (’SALES_TOOL_TYPE’, ‘Component’)) AND
[Created By]=LoginId()) OR ([Sales Tool Type] LIKE (LookupValue
(’SALES_TOOL_TYPE’, ‘Sales Tool’) + “*”))

We can also use * as wild character in our Search Specification for example

 [HTML Control Type] = “Field OR MiniButton*”


 [Name] LIKE *Siebel*

Constraining the PickList


As it is quite clear from the title that we are trying restrict the values in a pick list
based on certain constraints. It is best to explain with the help of a requirement.

Requirement
 Two fields having 2 Picklists
Country and State
 Based on country selected in country Picklist, only state corresponding to that country
should be displayed in state Picklist

For example
  Country = US then State Picklist should display only Ohio, Georgia, Texas
  Country = India then State Picklist should display M.P, U.P, A.P, Delhi etc

This post assumes that you have already created two Picklists and configured them
properly. Coverage of Picklist configuration is not in scope of this post but if you need
let me know I will be more than happy to include in my next posts

Solution
 Query for the BC in which you Picklist Field is created
 2. Select the Field to which you have mapped your Picklist
 Expand its child PickMap
 There should already be one record with the values shown below that you created
during you configuration of Picklist
Field: State
Picklist Field: Value
 Add another record in PickMap as shown below
Field: Country
Constraint: TRUE
Picklist Field: Description

  Compile the Business Component you have changed.


  Open the Siebel Client Application
 Goto Administration – Data> List of Values
  Query for the LOV_TYPE containing the State Picklist values.
 Update the name of country corresponding to state in description Field as shown below

  Click on Clear Cache

Your configuration of constraint Picklist is not complete you should be able to state
values based on country field.

Adding status indicator to Siebel entities


We have seen a Status Indicator Icon for Server Components in Server Management
Screen and now it is possible for us to add that to any entitiy. For example if I want a Service
Request to display different colors for different severities or Quotes to display different color
based on status. You can use the given example below and adapt it according to your needs.

We can implement the same behavior in a list applet. Please follow the below steps:

1. Select a List applet (e.g., Activity List Applet) and its BC (e.g., Action).
2. In the business component, create a new calculated field.
3. In the calculated value (e.g., Status Indicator), frame the logic that returns any of the
status value as mentioned above(e.g., IIF([TimeDiff] >0, “Unavailable”, IIF(([TimeDiff] >
-24), “Offline”,”Online”))
4. Go to the List Applet. and create a new List Column “Status Indicator” and set the
following properties as below.
HTML Icon Map = Server Administration Icon
HTML Type = Label
HTML List Edit = FALSE
Run Time = TRUE
5. In the List Applet, add the control “Status Indicator”.
6. Compile the BC and Applet.
7. In the application, go to the list applet and observe that the column “Status Indicator” is
displayed as in server administrator screen.

Workflow made simple - Part I


Recently, I had to do some prototyping for typical requirements which led me to the Siebel
Workflow framework as a solution.
As indicated in a previous post, workflow processes (along with the business services they call)
account for almost every piece of functionality and automation in Siebel CRM). So in general it
is a good idea to have an eye on workflow when it comes to automation solutions.
However, there are some pitfalls for the novice developer that often lead to frustration and even
refusal of using workflow.
In this and a following post, I will describe two workflows that should serve as examples how to
solve common problems in Siebel.

These are the requirements

1. Update multiple records (this post)


Users should be able to enter a search string to retrieve a list of Accounts and the target value
of the Account Status field. The system should then update the Account Status field of all
records in the result set to the target value.
2. Retrieve total opportunity revenue for an Account (future post)
Sum up the revenue of the current Opportunities for an Account and write the result to an
Account field.

I implemented both requirements on Siebel 8.1.0.0

Let's have a look at the solution to requirement #1.

To be honest, I was surprised at the simplicity of the workflow. It is a really nice example, how
the Siebel framework works.

The workflow is configured as follows:


Business Object: Account
Process Properties created: QueryField, Querytext, RecordCount,
TargetValue

The first Siebel Operation step is configured as follows:


BC: Account (No Link)
Operation: Query
Search Spec Expression: "[" + [&QueryField] + "] LIKE '" +
[&QueryText] + "*'"
Output: RecordCount = NumAffRows
The second Siebel Operation step is configured as follows:
BC: Account (No Link)
Operation: Update
Field Input Argument: Account State = Process Property:
TargetValue

Pitfall #1: Too complicated approach


Siebel Operations inside a workflow which operate on the same BC inherit the context of the
previous step, so all you need is one query operation and then the update operation will update
all records in the query result set. That's it.
Pitfall #2: Problems with the primary BC
There is strange behaviour to report when the Siebel Operations use the primary BC of the
workflow's Business Object (Account, that is). I used the Account (No Link) BC instead and it
worked like a charm. Please don't ask why ;-)
Pitfall #3: Externalize the query string
How in god's name can someone figure out the query string if she/he is not a complete geek?

"[" + [&QueryField] + "] LIKE '" + [&QueryText] + "*'"

is built as follows:

1. Parenthesize the value of the QueryField process property in


square brackets

"[" + [&QueryField] + "]"

2. Append the LIKE operator

"[" + [&QueryField] + "] LIKE"

3. Append an asterisk to the value of the QueryText process property


and parenthesize it in single quotes

"'" + [&QueryText] + "*'"

4. Bring all together

"[" + [&QueryField] + "] LIKE '" + [&QueryText] + "*'"

Not too difficult - but devilish

Note that the Siebel Operations have an output argument which is useful to get the
number of affected records.

Several tests showed that the workflow updated several hundreds of


records in short time.

Workflow made simple - Part II


...welcome back to Part II of our tour de workflow
Let's reiterate the requirement #2

Retrieve total opportunity revenue for an Account


Sum up the revenue of the current Opportunities for an Account and write the result to an
Account field.
This is the prototype workflow. As in part I, Siebel 8.1 was the implementation platform.

The workflow itself has the following properties:

Business Object: Account


Process Properties created: CurrentRevenue, LastRecord,
RecordCount, TotalRevenue

Get Oppties Step:


Business Component: Opportunity
Operation: Query
Search Spec Expression: "[Account Id]='" + [&Object Id] + "'"
Output Args: TotalRevenue = BC Oppty.Primary Revenue Amount
RecordCount = Output Argument NumAffRows

Decision Step Last Record?


yes = Process Property LastRecord = true
no = Default

Go to next Oppty Step


BC: Opportunity
Operation: NextRecord
Output Args:
CurrentRevenue = Opportunity.Primary Revenue Amount (1)
TotalRevenue = Expression: [&TotalRevenue] +
[&CurrentRevenue] (2)
LastRecord = Output Arg: NoMoreRecords (3)
Note: Numbers in brackets indicate the sequence of the output
arguments

Update Account Step


BC: Account
Operation: Update
Field Input Arg: Revenue = Process Property TotalRevenue

Note #1: The workflow operates on the Account Business Object


with Account BC as the primary BC and Opportunity as a child BC.
Note #2: Despite Note #1 it is still necessary to execute a query to
get the Opportunites associated with the Account.

Note #3: The fairly new Siebel Operation NextRecord (along with its
siblings PreviousRecord and QueryBiDirectional) has been
introduced in Siebel 8.0. It is the first version that allows us to loop
through a record set in a workflow without being outwitted by the
complexity of looping. The NextRecord operation has an output
argument of NoMoreRecords (true or false) which must be used in
a decision step to determine whether the loop has to end or not.

Pitfall #1: Adding up the revenue amount requires two process


properties. One to get the field value from the BC and the other one
to serve as the accumulator. Note the sequence in the NextRecord
operation to fill them in the correct order.

Hope you enjoyed this small workflow series. If you want more, drop
a comment ;-)

Using the DefaultFocus Applet User Property


Users are trained to use the Account name field in the opportunity list to search for
opportunities. However, when they use ALT+Q to enter query mode, the first column in the list
has the focus, so they have to tab to the Account column. They want to have the cursor in the
Account column once they enter query mode, irrespective of the placement of the column.
Here is a simple way to implement this. It introduces the DefaultFocus Applet User
Property, which, if memory serves me correctly, has been introduced in Siebel 7.8.
First we add a new Applet User Prop to the Opportunity List Applet.
We use DefaultFocus_Query = Account to define the default focus column for the Query Mode.

Note that you can use DefaultFocus_Edit for Base, Edit and EditList mode and
DefaultFocus_New for the New mode.

After compiling the .srf file, we can run a test....

And voilá, click Query and you find the focus on the Account column. So you can speed up your
work by simply entering the search string and hitting the ENTER key.
There also was another requirement to have the focus on the Query button. However, using
DefaultFocus_Edit = NewQuery did not yield the desired result. The funny thing was that the
Query button only got focus after pressing ALT+ENTER (or invoking the ExecuteQuery
command). Maybe the answer to that problem is somewhere out there...

siebel.exe switches
...and siebdev.exe too ;-)

siebel.exe, as we all know, is the engine behind the non-zero-


footprint flavour of Siebel applications, namely the Mobile Web Client
or the Developer Web Client. Some call it fat client, some call it
dedicated web client, depending mostly on the year when they first
heard about it. Discussions whether the Mobile Web Client is a
different installer than the Developer Web Client and whether the
Developer Web Client is the same thing as the fat client often reach
religious depths.

The installer places a bunch of shortcuts in the windows start menu


which usually follow the syntax of

<path to siebel.exe> /c <path to .cfg file>

So /c is a mandatory switch because any Siebel applications consists


of the very same executable along with a different configuration file
from which it reads the rest of its knowledge.

In order to please the more inquisitive among you, find below a


complete list of switches that you can use with siebel.exe. If you
know of any other switch, please inform us.

Typical switches (used in shortcuts)

/c Path to .cfg file (required), directory path defaults to


<client_installdir>\bin\enu
/d Datasource (as in .cfg file), defaults to local
/l language (optional, language pack must be installed), defaults to
enu
/u Username (optional)
/p Password (optional)
/s Path to spool file (optional, to spool all SQL generated by
siebel.exe)

Extra switches

/b Path to Browser executable (optional, for multi-browser testing of


customer or partner (SI) applications)
/h Debug Mode (used with Siebel Tools for debugging)
/ctsim (often confused with /ctisim, which does not work ;-) CTI
Simulation mode (used for demo)
/editseeddata allows modification of seed data, often referred to in
maintenance release guides

And now for siebdev.exe:


siebdev.exe is the engine behind Siebel Tools, which is the only
application that does not run in a browser window. However, Siebel
Tools is defined in the Siebel Repository and the siebdev.exe works
just like the siebel.exe. That is, it reads a .cfg file and an .srf file (the
file that newbies usually try to compile to during their first steps with
Siebel Tools).

So siebdev.exe accepts most of the switches that siebel.exe does,


namely /c, /d, /u, /p and /s.

But there are some additional switches, used in conjunction with the
"classic" ones. They have been passed along from consultant mouth
to consultant ear for eons before they found their way into the
documentation.

/bv runs all validation rules for the entire repository, so take your
time
/batchimport automates the import of .sif files
/batchexport automates the export of objects to .sif files
/bc allows to run batch compilation
/tl language (typically used with /bc for multiple language
deployments)
/applybatchpatch is used for applying batch patches, or patches in
batches.

How to Automate Siebel Full Compile


In our project a normal Siebel release cycle is of 3 months. This means that
we develop for three months and then it goes live in production. Now during our
development phase of 3 months we run Full Compile of SRF almost on daily basis
and it is usually somebody’s responsibility to start the Full compile.
Now, like most of the clients our client is also US based which means during
the last phases of development cycle client tests (UAT) the changes we have done
their morning and our evening. During that time the time it is very important to
start full compile on time otherwise it could impact client’s testing. After couple of
incidents where the person responsible to start full compiles couldn’t do so due to
some problem. We decided to automate the process of full compile to get rid of this
problem.
We created a batch file which was as following:
 cd "c:\program files\siebel\7.8\tools\bin\siebdev.exe /c tools.cfg /d
SERVER /u USERNAME /p PASSWORD /bc "Siebel Repository"
"FullCompile.srf"
(Replace the username and password with your Siebel Username and
Password)
Details of switches used are as following
/C: Tells the configuration file to use.
/D: Data source which should be used.
/U: Username to start full compile.
/P: Password to start full compile.
/BC: Repository which should be used for full compile.
Last parameter is the SRF Name.
Now to automate the running of this batch file. The steps are valid for Windows
2000 OS
 Goto Control Panel > Scheduled Tasks
 Double click on Add Scheduled Tasks
 Click > Next. (You will see the window shown below)

 Click > Browse (Select the batch file you have created)
 Click > Next and then select Daily Option and Click Next
 Select the Time at which you want to start he full compile
 Click Next and provide the password and confirm password for
username you use to login to Windows OS
 Click > Next and then Click > Finish
This full compile will create SRF in Siebel Tools\Objects\ENU folder.
You will now see a scheduled task created in the control panel. In this way
your full compile will always start on time.
To automate on UNIX or Solaris systems you can create a Shell Script and
cron job.

Accessing Siebel Repository Information


Requirement
To retrieve the following information for some list applets in Siebel
Application:
 Display Names of Fields in those list Applets.
 Data Type of the fields associated with the Fields.
 Fields have Picklist associated with them or not.
 Fields have their Runtime Flag checked or not.

Solution
One way to do was to open application get display names from application
and then go to Siebel Tools and query one by one to get the Data Type and also
query in Applet Section to get Runtime flag and other information
This code queries for the given applet name, get’s all the records that are
mapped in UI and then queries one by one in Business Component to extract their
datatype and also if they have any picklist associated with them or not.
This is not a very common requirement. You can use this code to
understand repository BC’s and their relationship.
Code:
function GetInfo ()
{
var AppletBO = TheApplication().GetBusObject("Repository Applet");
var AppletBC = AppletBO.GetBusComp("Repository Applet");
var WebTemplate = AppletBO.GetBusComp("Repository Applet Web Template");
var WebTemplateItem = AppletBO.GetBusComp("Repository Applet Web Template
Item");
var FinalStr = "";
var flagbreak = 0;
var listcolname = "";

var BusCompBO = TheApplication().GetBusObject("Repository Business


Component");
var BusCompBC = BusCompBO.GetBusComp("Repository Business Component");

var count = 0;
var isRecordBC = 0;
var appletfield= "";
var bcfield = "";
var controlname = "";
var picklist = "";

AppletBC.ClearToQuery();
AppletBC.SetViewMode(3);
AppletBC.ActivateField("Business Component");
AppletBC.SetSearchSpec("Repository Name","Siebel Repository");
AppletBC.SetSearchSpec("Name","Opportunity List Applet");
AppletBC.ExecuteQuery();
if(AppletBC.FirstRecord())
{
WebTemplate.SetSearchSpec("Name","Edit List");
WebTemplate.ExecuteQuery();
WebTemplateItem.ActivateField("Control");
WebTemplateItem.SetSearchSpec("Inactive","N");
WebTemplateItem.SetSearchSpec("Type","List Item");
WebTemplateItem.ExecuteQuery();

var isRecordTemplateItem = WebTemplateItem.FirstRecord();

var AppletListBC = AppletBO.GetBusComp("Repository List");


AppletListBC.SetSearchSpec("Name","List");
AppletListBC.ExecuteQuery();
if(AppletListBC.FirstRecord())
{
var AppletListCol = AppletBO.GetBusComp("Repository List Column");
AppletListCol.ActivateField("Display Name");
AppletListCol.ActivateField("Field");
AppletListCol.ActivateField("Runtime");
AppletListCol.SetSearchSpec("Inactive", "N");
AppletListCol.ExecuteQuery();
var isRecordApplet = AppletListCol.FirstRecord();
BusCompBC.ClearToQuery();
BusCompBC.SetViewMode(3);
BusCompBC.SetSearchSpec("Name", AppletBC.GetFieldValue("Business
Component"));
BusCompBC.SetSearchSpec("Repository Name", "Siebel Repository");
BusCompBC.ExecuteQuery();
if(BusCompBC.FirstRecord())
{
var BusCompField = BusCompBO.GetBusComp("Repository Field");
BusCompField.ActivateField("Type");
BusCompField.ActivateField("Name");
BusCompField.ActivateField("Picklist");
BusCompField.ExecuteQuery();
while(isRecordTemplateItem)
{
controlname = WebTemplateItem.GetFieldValue("Control");
isRecordApplet = AppletListCol.FirstRecord();
while(isRecordApplet)
{
listcolname = AppletListCol.GetFieldValue("Name");
if(controlname == listcolname)
{
isRecordBC = BusCompField.FirstRecord();
while(isRecordBC)
{
bcfield = BusCompField.GetFieldValue("Name");
appletfield = AppletListCol.GetFieldValue("Field")
if(bcfield == appletfield)
{
if(BusCompField.GetFieldValue("PickList") != "")
picklist = "Y";
else
picklist = "N";
FinalStr = FinalStr +
AppletListCol.GetFieldValue("Display Name") +
"," + BusCompField.GetFieldValue("Type") +
"," + AppletListCol.GetFieldValue("Runtime") +
"," + picklist + "\x0a\x0d" ;
count++;
flagbreak = 1;
break;
}
isRecordBC = BusCompField.NextRecord();
}
}
if(flagbreak == 1)
{
flagbreak = 0;
break;
}
isRecordApplet = AppletListCol.NextRecord();
}
isRecordTemplateItem = WebTemplateItem.NextRecord();
}
TheApplication().RaiseErrorText(count + FinalStr);
}
}
}
}

Validating an Email Address in Siebel


Requirement
A person should not be able to enter an invalid email address in the field.

Solution without Scripting


A simple expression in Validation column of the field can do the trick. The
expression is as following:
 *@*?.?*
But this solution is not full proof and has the following limitations:
 The error message displayed is not user friendly.
 Not all the validations can be done. For example it fails if a user is
going to enter @@dfjkd.com as email id as we cannot check if the
character before @ is a valid character or not.

Solution with Scripting


Function given below will return 1 the email id provided is valid and
return 0 if the email id is invalid

function ValidateEmail(emailid)
{
   var pat = /(^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$)/g;
   var valid = emailid.replace(pat,”Y”);
   if(valid == “Y”)
      return(1);
   else
      return(0);  
}
Count (”MVL Link”) - reducing scripting
This article describes how to use Count Function in calculated field involving
MVL link to count number of child records for a BC and then base our conditions on
that to fullfill our requirement.
Very often we have scenarios where conditions have to be set based on the
count or number of records in child BC. This can be achieved using the function
Count(“MVL Link”) in a Calculated expression and setting conditions with help of
user properties. Let’s understand it with help or a Requirement.

Requirement
A field “Currency” in “Opportunity” BC should be read only based on the
number of records in child BC “Service Agreement“. If the agreement child
record count > 0 then Currency should be read only and it should be editable
if the child record count = 0.

Solution

Count (“MVL Link”) used as an expression in a calculated field returns the number of
records in child BC.

Following configuration in Tools is required to achieve the above functionality:

» For the “Opportunity” Business component, create the Multi Value Link record
“Service Agreement” and set the following property for the record: Destination Link =
” Opportunity/Service Agreement ”

» Add following fields to “Opportunity “ Business Component.

Name: Service Agreement Count


Calculated: True
Calculated Value: Count (”Service Agreement”)

Name: Currency Read Only Flag


Calculated: True
Calculated Value: IIF ([Service Agreement Count] = 0, “N”, “Y”)

» Add following BC User Property to Opportunity Business component to make


Currency Field Read only

Name: Field Read Only Field: Currency


Value: Currency Read Only Flag

This will make “Currency” Field editable only when Agreement record count = 0  and
read only if agreement count > 0.

Anda mungkin juga menyukai