You are on page 1of 8

Question: How to make applet read only in Siebel?

Answer: To make applet permanently read only, one can use No Update, No Insert, No Delete, No
Merge property on applet to true. Read more

Question : How to build validation in Action Business Component to ensure that


Start date is always a future date?
Answer: Validation field and validation message can be used to enforce the date entered. To check
the future data following Syntax can be used.
> Today()

Question: How to create validation for first name field in Contact BC to have at
least 5 characters?
Answer: Length method can be used in validation field to ensure minimum number of characters
are entered in the field.
Syntax :
Len([First Name]) > 5

Question : How does Primary Id field improves performance of an MVG field?


Answer: By default every MVG field executes a separate query on database to fetch data from
child BusComp. When primary id field is specified and use primary join flag is set, application
does not execute sub-query and instead uses join to fetch the data.

Question : What are the implications if Primary ID field is not used in MVG?
Answer: If Primary Id is not specified on an MVG then view will take a lot more time to load as
for every record in list applet another subquery will be executed.

Question : Is it possible to deploy SRF on server if objects are not checked in


repository?
Answer:Yes, for Business Service, BusComps, BusObjects and Applet changes, srf can be
deployed on server without checking in the objects, however workflow needs all the BO and BC
to be checked in before it is activated.

Question: How to disable new record creation for certain users of Siebel?
Answer: Applet's PreCanInvokeMethod Method can be used to disable new button by setting
CanInvoke to false, this can be done conditionally by checking the position or responsibility of the
current user.

Question: How to make field editable for certain group of users only?
Answer: Create field read only field user property for the field and use calculated field expression
to check the responsibilities of user, return N if user has the responsibility to edit the field and Y if
it doesn't
Calculated field expression:
IIF(InList("Edit Field",GetProfileAttrAsList("User Responsibilities"))='Y','N','Y')
This way user who don't have the responsibility will see the field readonly.

Question : How to access user preference in script?


Answer: User preferences in siebel are stored in special class base bc which gets its values from
spf files stored in file system. Through script user preferences can be retreived by querying the
User Preferences BC like :
var oBOUser = TheApplication().GetBusObject("User Preferences");
var oBCUser = oBOUser.GetBusComp("User Preferences");
with(oBCUser)
{
SetViewMode(AllView);
ActivateField(fieldName);
ClearToQuery();
ExecuteQuery();
if (FirstRecord())
{
sDefTempValue = GetFieldValue(fieldName);
}
}

Question : How to access system preference in escript?


Query System Preferences BC on Name and Value fields to get the value of system preference..
var boSysPref = TheApplication().GetBusObject("System Preferences");
var bcSysPref = boSysPref.GetBusComp("System Preferences");
bcSysPref.ClearToQuery();

bcSysPref.ActivateField("Value");
bcSysPref.SetViewMode(AllView);
bcSysPref.SetSearchSpec("Name", sName);
bcSysPref.ExecuteQuery( ForwardOnly );
if (bcSysPref.FirstRecord())
{
sValue = bcSysPref.GetFieldValue("Value");
}return(sValue);

Question : How to set system preference in Siebel?


Answer: "Administration Application> System Preference" view can be used to set the value of
system preference.

Question . What could be reason behind a Picklist field which is not showing the
drop down icon?
Answer: There are only three reasons for picklist not showing drop down:
Picklist is not specified on BusComp field.
Picklist is not compiled or Picklist values are not created.
Control's Runtime property is not set to true on Applet

Question : Is it possible to make calculated field as editable?


Answer: Yes, by setting setting pick map on calculated field and field becomes editable, however
it won't be able to save the value and will recalculate the value on refresh record.

Question : How can you get the value of parent field value in browser script?
Answer: Only fields displayed on UI are accessible in browser script, it is applicable for all the
parent and child bus components.

Question : When do you think applet toggle should be implemented?


Answer: Applet toggles should be implemented when number of relevant fields are less than
displayed fields. With use of applet toggle, only relevant fields can be displayed to the user which
decreases the time spent in data entry.

Question : Is there any performance impact on the application of using applet


toggles?
Answer : Yes, Siebel loads all available applets each time user navigates to a view having toggle
applets, and complete screen is refreshed when applet is changed.
"Siebel CRM loads all available applet toggles each time the user navigates to an applet."

Question : How to debug a toggle applet in Siebel?


Answer:
Check the field name in business component on which applet toggle is based on.
Expose the field on the applet to verify the value and verify the value.

Check if the field's Immediate Post Change property is set to true.


Test toggle applet with two applets first and then increase numbers if required.
Compile all objects again.

Question : What are different forms of applet toggles?


Answer: Static and Dynamic Applet Toggle
Static Applet toggle gives user option to choose the applet from drop down control, whereas
dynamic applet toggle refreshes the view with new applet depending upon the field value.

Question : How to configure a new dynamic applet toggle in Siebel?


Answer:
A) Create a copy of applet and change the fields as required.
B) Go to the original applet and create new applet toggle record.
C) Specify the Applet toggle field and applet toggle value along with the name of the new applet.
After this configuration new applet will show instead of the original applet whenever the field
value matches with the value specified in the tools.
Question: Which Siebel objects supports scripting?
Answer: Script can be written on following objects in Siebel:
1. Business Services
2. Client Side Business Services
3. Business Components
4. Applets
5. Application
6. Product Configurator Events
7. Smart Scripts
8. Workflows (via business services)
9. Open UI js class files
10.Browser scripts on Applets, BusComps, Application, Business Services
11.Siebel Webtemplates SWTs
12.?????

Question : How to change primary record of MVG using scripting?


Answer: Primary record of MVG can be changed by setting the SSA Primary Field of
the associated record.
Script could look like:
bcOpty.ClearToQuery();
bcOpty.ExecuteQuery();

if(bcOpty.FirstRecord())
{
var bcMVG = bcOpty.GetMVGBusComp("MVF Name");
bcMVG.ActivateField("SSA Primary Field");
bcMVG.ClearToQuery();
bcMVG.SetViewMode(AllView);
bcMVG.SetSearchSpec("Id", "1-12345");
bcMVG.ExecuteQuery();
if(bcMVG.FirstRecord())
{
bcMVG.SetFieldValue("SSA Primary Field", "Y");
bcOpty.WriteRecord();
}
}

Question : How to set pick list field using script?


Answer: GetPicklistBusComp() Pick() methods are available in eScript by which
system can search on pick list buscomp and pick desired record.
Syntax for pick method can look like:
oPickBusComp = buscomp.GetPickListBusComp("FieldName");
oPickBusComp.ClearToQuery();
oPickBusComp.SetSearchSpec("Id","12345");
oPickBusComp.ExecuteQuery();
oPickBusComp.Pick();
buscomp.WriteRecord();

Question : How to show a confirmation(Ok/Cancel) dialogue box in Siebel?


Answer: Confirmation Dialog box should be implemented through browser script
using javascript confirm method. This method prompts users with option to proceed
or cancel the process.

Click here for example.

Question : How to call batch file through scripting?


Answer: Siebel provides C libraries to access the host of Siebel server.
Clib.system() is one of those functions which allows script to pass some instructions
to command processor of server host.
Using this method, a batch file can be invoked from Siebel which can do OS level
changes.
Following instruction can execute Siebel.bat file on the server:
Clib.system("C:\\Scripts\\Batch\\Siebel.bat");
Question : How to update read only fields in Siebel?
Answer: Fields in Siebel are configured as read-only using "Field Read Only Field"
and "BC Read Only Field" user properties. These user properties does not work on
views where admin mode flag is set to Y.
BusComp.InvokeMethod("SetAdminMode", flag)
Question: What is the difference between SetAdminMode and SetViewMode(AllView)?
Answer :

SetAdminMode mimics the behaviour of Admin Views, and is used to update


read only fields

SetViewMode instruction changes the default view mode of the business


component, it used to access records which are not visible with default view
mode.

Question : Is it possible to invoke workflow through browser script?


Answer: Workflow can be invoked through browser script if "Workflow Process
Manager" declared as Client side business service in Application's User Property.

Question : What type of error handling is available in Siebel eScript?


Answer: try catch finally instructions helps to handle run time errors in e-script.

try block marks the code which needs to handled

catch block declares commands which should be executed in case of error,

finally block is executed after try and catch has completed executing.

try
{
statement_block
}
catch
{
exception_handling_block
[throw exception]
}
finally
{
statement_block_2
}
Finally block is always executed no matter if there was error encountered or not.
Question: How to get language of Object Manager?
var lang = TheApplication().InvokeMethod("LANGUAGE");

Question : What is difference between ActiveBusObject() and GetBusObject()


methods?
Answer: ActiveBusObject is mostly used in UI based scripting requirements, this
method can only return the handle of current BO instance.
For example: In Accounts screen ActiveBusObject will return Account BO and
subsequent .GetBusComp().GetFieldValue will return the information from the record
selected by user.
Same script in Contact Screen will return the Contact BO.

Important Points about ActiveBusObject:


- It is not recomended to use ClearToQuery and ExecuteQuery on BC of
ActiveBusObject as UI context for user will get lost.
- ActiveBusObject is the only way to get BO in browser script.
GetBusObject method should be used when current BO instance does not have the
BC of interest. We can get handle of any BO in application using GetBusObject This is
mostly used in background processes and workflows.

You might also like