Monday, July 25, 2011

Difference between Alert() and SWEAlert Functions

  • In Siebel 2000 and earlier releases, developers could use the application methods such as MsgBox and InputBox to create a dialog box and get input from the users.
  • In Siebel 7, these methods are not supported, but the developer could still achieve the same in browser script with the help of JavaScript functions such as Alert, Prompt and Confirm.
  • Siebel applications version 7.5.3 and higher also includes a method known as SWEAlert method 
The Alert Function and SWEAlert Method:
These functions allow you to display messages and obtain input through browser scripting.

The alert function will pop up a message box and display an OK button.
The syntax is as follows: alert(The Message To Display );

Where as from Siebel applications version 7.5.3 and higher, the Alert function is incorporated into the Siebel interfaces methods through the application SWEAlert method.
and you should use the SWEAlert method rather than the alert function in versions 7.5.3 and higher, unless the script is running in standard interactivity (SI) mode.

PLEASE Note:
The Alert function is only supported in Standard Interactivity mode. 
while the SWEAlert method is only supported in high interactivity mode.

the syntax for SWEAlert method is :
theApplication().SWEAlert("message")

One advantage of using the SWEAlert method instead of the Alert function is the behavior. If the alert is invoked on a popup applet such as an MVG applet. When Alert window displayed using Alert(), the MVG applet disappears behind the main application applet, but it won't when used with SWEAlert().

Saturday, July 23, 2011

RaiseError Method

To Start, RaiseError Method is one of the Application Methods.
The RaiseError method raises a scripting error message to the browser.
When invoked, the RaiseError method causes execution of the script to terminate, and sends a notification to the browser. Therefore, CancelOperation is not required after RaiseError.

Be careful when using RaiseError, because it cancels operations. For example, if it is used
in BusComp_PreWriteRecord, the user or code will not be able to step off the current record until the
condition causing the RaiseError method to be invoked is addressed.

The following eScript example raises the error message “This user-defined test error is used in

PreDelete, as an example for RaiseError Method” when deleting an opportunity with the “Pipeline”
revenue class. Note that the key "user-defined test error1" is predefined as "This user-defined test
error is used in %1, as an example for %2". When the script runs, 'PreDelete' is substituted for %1
and 'Raise Error Method' is substituted for %2.

function BusComp_PreDeleteRecord ()
{
try
       {
var revClass = this.GetFieldValue("Primary Revenue Class");
if (revClass == "1-Pipeline")
   {
TheApplication().RaiseError("user-defined test error1", "PreDelete",
"RaiseError Method" );
      }
else
{
return (ContinueOperation);
}
}
catch (e)
 {
     throw e;
 }
}

Followers

Search This Blog