Thursday, February 17, 2011

Enable a button using eScript

This post is also a contribution by Vaibhav. Thanks to him for sharing his knowledge with all of us.

I will tell siebel newbees how to activate a button on an applet using escript. Suppose we have created a button on an applet (i assume reader know how to set a button on an applet) and want to enable this button as soon as applet loaded in the application.
Now first question in mind, where should we write script (which event)?
Ans is as soon as applet loaded so better to write PreCanInvoke event of the applet.
here is the server script of the applet.

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if (MethodName == "TestMethod")
{
CanInvoke = "TRUE";
return(CancelOperation);
}
return(ContinueOperation);
}


Siebel Browser Script for Newbee

This post is a contribution by Vaibhav Raj Saini who is having 3+ yrs of experience in siebel, sales logix and Java. I am sure his post will be a looping out solution for those who could not find starting point.

Once my (Vaibhav's) colleague who want to enter in siebel asked me how to learn siebel scripting then i told him let see a magic and i wrote a java script in my siebel application address bar and as soon as i hit enter it showed a alert message. you can go through these script and you know what will be the alert message.

javascript:alert(theApplication().GetProfileAttr("ActiveViewName"));

javascript:alert(theApplication().GetProfileAttr("Application Name"));

 Then i told him siebel script is just like a java script the only thing you must know is the key word used in siebel for that you have to open siebel bookshelf and have a look at example script.

later on in our discussion i showed him how to write a Hello world script in siebel.

theApplication().alert( "Hello Word");

then how to show a field value in broser script

var msg = theApplication().ActiveBusObject().GetBusComp("Contact").GetFieldValue("Job Title");
theApplication().SWEalert( "" + msg);

and this way he got a start in siebel scripting.




Thursday, February 10, 2011

'CanInvokeMethod' as Applet User Property

One day i was writing a custom method so i created a control on applet and Enabling button explicitly by using applet user property as below.




I compiled and tested many times but no luck. then i put space between colon and Method Name as below
CanInvokeMethod: TestMethod
then it start working. 
I don't want any other waste time for such silly things and this leads to creation of one more blog named as "SiebelUniverse".

if anyone of you found any strange or worth noting things on this user property please share with siebeluniverse through comment.