Tuesday, April 23, 2013

i am back

Hi All,


after a long gap i am back in action

regards
jo

Scripting -->In an Read Only view i want to make the buttons Read Only


IsViewReadOnly Method

You can use the IsViewReadOnly method to test whether a view is read-only

Syntax
Application.InvokeMethod("IsViewReadOnly",viewName)


viewName: The name of a view, as defined in Siebel Tools, in double quotes or a variable containing the name of a view.
 Returns:Returns TRUE if the view is read-only, else it returns FALSE. If neither of these values is returned, then an error has occurred. Your script must provide a handler if neither TRUE nor FALSE is returned.

Sample Code :
function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
                var sviewname = TheApplication().ActiveViewName();
 if (TheApplication().InvokeMethod("IsViewReadOnly",sviewname) == "TRUE")
                {
                                if (MethodName == "<<CustomMethod>>")
                                 CanInvoke = "FALSE";
                                 else
                                CanInvoke = "TRUE";
                                return CancelOperation;
                }
                return (ContinueOperation);
}


regards
jo