Siebel SmartScript Administration Guide > Verifying, Testing, and Invoking SmartScripts > About Invoking SmartScripts >
Invoking Scripts Using Siebel VB or Siebel eScript
You can invoke SmartScripts programmatically using the application invoke method RunSmartScript or the applet invoke method RunCallScript. The invoke method, RunCallScript, invokes a SmartScript from an applet so the SmartScript updates the currently active record. NOTE: The name of the SmartScript used in the RunSmartScript and RunCallScript application methods must be a basic (path) name of a SmartScript, which is not the translated SmartScript name which appears in the SmartScript Player applet.
RunSmartScript
This function invokes a SmartScript programmatically. Syntax
RunSmartScript callScriptName, pathId, language, currency, viewName, appletName
|
|
callScriptName |
Name of the SmartScript, or "" (quotation marks) if pathId is specified |
pathId |
Row ID of the SmartScript, or "" if ScriptName is specified |
language |
A language code |
currency |
A currency code |
viewName |
Name of the view to be displayed if it is not the agent's SmartScript view |
appletName |
Specify the name of the applet if you want to invoke the SmartScript on a view where the applet is a clone of the SmartScript Player Applet |
Returns
Not applicable Usage
For consistency, the arguments to RunSmartScript are identical to those of RunCallScript, except for the additional viewName and appletName parameters. The viewName parameter allows a view other than the default agent's SmartScript view to be accessed. This is useful if an alternative view is configured for a specific purpose. The view specified must contain an instance of the SmartScript Player Applet to present the SmartScript interface to the agent. Siebel VB Example
InvokeMethod "RunSmartScript", "Pentium II Script", "", "ENU", "USD"
Siebel eScript Example
InvokeMethod ("RunSmartScript", "Pentium II Script", "", "ENU", "USD");
Siebel Applet Button Example
Sub ButtonScript_Click TheApplication.InvokeMethod "RunSmartScript", "Pentium II Script End Sub
RunCallScript
This function is similar to RunSmartScript in that it programmatically invokes a SmartScript. However, RunCallScript positions the SmartScript on the currently active record from the applet from which the SmartScript was invoked. This can be invoked by filling in the Method invoked property of the button to be RunCallScript. Alternatively, an administrator can invoke it using VB in order to pass in the additional parameters. Syntax
RunCallScript SmartScriptName, pathID, language, currency
|
|
SmartScriptName |
Name of the SmartScript, or "" if pathId is specified |
pathId |
Row ID of the SmartScript, or "" if ScriptName is specified |
language |
A language code |
currency |
A currency code |
Usage
RunCallScript allows a SmartScript to update an existing record. Use RunCallScript behind a button on an applet. This usage works in an identical manner to the script button on the Account, Contact, and Opportunity Profile views. Siebel Applet Button Examples
Function WebApplet_PreInvokeMethod (MethodName As String) As IntegerSub
if MethodName = "MyRunCallScript" then
InvokeMethod "RunCallScript", "Pentium II Script","","ENU","USD"
WebApplet_PreInvokeMethod = Cancel Operation
else
WebApplet_PreInvokeMethod = ContinueOperation
end if
End Function
|