return(CancelOperation) statement is used to send the control back to Siebel or in other words to stop the normal flow of execution of script of a particular event.
This statement is mandatory if we are defining a custom method. For example:
I create a button and give the method name as “CustomMethod”. Now, in BusComp PreInvoke event I write the following script
if(MethodName == “CustomMethod”)
{
My Script
}
If I don’t write the statement return(CancelOperation) at the end then I am going to get error saying: method “CustomMethod” is not supported by BusComp”
So, the correct and complete script when handling a custom method will be
if(MethodName == “CustomMethod”)
{
My Script
return(CancelOperation);
}