A few days ago somebody asked a question on Siebel Forum to explain about eScript and details about various events available to us in Siebel BC, Applet etc.
I thought it was a pretty good question and there is not lot of information available out there that can tell when to use which event. I have taken quite a few interviews and rarely do I get right event where the script should be written. For example consider this requirement.
Requirement:
We have Service Request BC as parent and Solution BC as it’s child. We want to change the status of SR to “Closed” when the status of the Solution is changed to “Done”.
I know this can be done with configuration but if this were to be done with scripting where would you write the script
Usual Answer:
Quite strangely the most common answer that I have got is that we will have to write the script at Service Request BC and in SetField Event . This answer is absolutely wrong. One more answer that I get is that we will have script at SetFieldValue of Solution BC which is also wrong.
Answer:
We will have to write script at WriteRecord Event of Solution BC. The reason being, that SetField Event of BC fires when you change a field value but user can still UNDO the record by pressing ESC key and then your script won’t revert back the Service Request Status.
Write Record event fires after the record has been committed in database and that would mean user cannot UNDO the record.
This is just a simple example explaining very often used Events in BC. I will try to cover all the and explain things like
When to use a Particular Event?
Why to use it?


(4 votes, average: 3.5 out of 5)
8 Comments at "Exploring different eScript Siebel Events"
Good post.Looking forward for more on siebel events.
Hi Neel,
You mentioned that above required can be achieved through configuration. Can you elaborate the same?
ok. I Got it from the comments of article “Updating Parent based on Child Records” but seems like it is not ideal solution if we are using a database column.
It is an ideal solution but it is incomplete in the comments example.. we will need to create a user property to udpate the database coloumn..
Yes, we need use UP “On Field Update Set” on the BC “Solution”, and create a calc field on BC “Solution” to get parent BC field “SR Status”. The parent BC field “SR Status”’s attribute “Link Spec” should be set to “True”. In the UP “On Field Update Set” we can set the value as “Solution Status”, “Done”, “[Calc SR Status] = ‘Closed’”
Hi I am trying to use the below code to track the Events but I failed . Can some one tell what more I have to do to make it work .
By the way I am a new bee and and I got this code on a blog.
Here is the link http://blogs.oracle.com/siebelessentials/2008/10/
if ( MethodName == “Trace” )
{
try
{
var message = ” “;
var ticks : float = Clib.clock();
if (Inputs.PropertyExists(”message”))
{
message = Inputs.GetProperty(”message”);
TheApplication().Trace(ticks + ” ” + message);
}
//retrieve input params from runtime event action set
if (Inputs.PopertyExists(”Event Type”))
{
var event_type = Inputs.GetProperty(”Event Type”);
var object_name = Inputs.GetProperty(”object Name”);
var event_name = Inputs.GetProperty(”Event Name”);
var context_string : String = Inputs.GetProperty(”Context”);
var context_array = context_sting.split(”,”);
message = context_array[1] + ” ” + event_name + ” ” + event_type + ” ” +object_name;
TheApplication().Trace(ticks + ” ” + message);
}
/*use code below to write Inputs to file
var oSvc = TheApplication().GetService (”EAI XML Write to File”);
var iPS = TheApplication().NewPropertySet();
iPS = Inputs;
iPS.SetProperty(”FileName” , “c:\\tracing_service_input.xml”);
var oPS = TheApplication().NewPropertySet();
oSvc.InvokeMethod(”WritePropSet” ,iPS ,oPS); */
}
}
i think the best place to ask this question is
http://forum.siebelunleashed.com
but what is the problem with the code???
you7246mk has given a suggestion which updates a Calculated Field using UP:
“[Calc SR Status] = ‘Closed’”
calculated fields are always read-only and cannot be directly updated by any means.
we shud use a link to SR Status field, instead of a calculated field.
Comment Now!