Check Domain & Buy at Low Cost

Monday, March 17, 2008

Siebel How To - enable or disable a button conditionally?

I was working on my desk one day and newbie to siebel approached me to ask a question(also a avid reader on asked me the same question on mail). He asked me about a simple requirement or rather I should say the requirement that appeared simple to me.

The requirement was :

A button on an Applet should be enabled if a particular user logs into the application otherwise it should remain disabled.

The Solution is a simple script that we can write on Applet_PreCanInvoke event to enable or disable a button conditionally.I am providing the pseudo code for that script below


function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if (MethodName == “UrButtonMethod”)
{
if(UserLogin == “AuthorisedUser”)
{
CanInvoke=”TRUE”;
return (CancelOperation);
}
else
{
CanInvoke=”FALSE”;
return (CancelOperation);
}
}
}

No comments: