Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Business Service Events >
Service_PreInvokeMethod
The PreInvokeMethod event is called before a specialized method on the business service is invoked.
Syntax
Service_PreInvokeMethod(methodName, InputArguments, OutputArguments)
Returns
"ContinueOperation" or "CancelOperation"
Usage
If implementing a new method, or overriding the behavior of a method implemented in a specialized business service, the script should return CancelOperation to avoid invoking an "Unknown method name" error. As Figure 14 illustrates, this error is predictable if the PreInvokeMethod event is scripted. This occurs because there is no native code to execute in the InvokeMethod event. CancelOperation tells the Siebel application to cancel the remaining operations associated with the event.
NOTE: The example in Figure 14 applies only to new and user-defined methods. For existing standard Siebel methods, it is not necessary to use CancelOperation.
Service_InvokeMethod is rarely scripted, but can be used for such post-operation events as posting a notice to a log when the event completes successfully.
Used With
Browser Script, Server Script
Example
This Siebel VB example creates the new service "Shipping Engine."
Function Service_PreInvokeMethod (MethodName As String, Inputs As PropertySet, Outputs As PropertySet) As Integer
If MethodName = "CalculateShipping" Then
Dim sShipper As String, sShipMethod As String
Dim dWeight As Double, dSize As Double, dCost As Double
Dim sZone As String, DelDate As Variant
Dim sCost As String, iReturn As IntegeriReturn = ContinueOperation
sShipper = Inputs.GetProperty("Shipping Company")
sShipMethod = Inputs.GetProperty("Ship Method")
dWeight = Val(Inputs.GetProperty("Weight"))
dSize = Val(Inputs.GetProperty("Total Dimensions"))
iZone = Val(Inputs.GetProperty("Zone"))
DelDate = DateValue(Now)Select Case sShipper
Case "GlobalEx"
Select Case sShipMethod
Case "Next-Day Air"
dCost = 14 + dWeight
DelDate = DelDate + 1
Case "Second-Day Air"
dCost = 11 + (dWeight * .54)
DelDate = DelDate + 2
End SelectCase "Airline"
Select Case sShipMethod
Case "Next-Day Air"
dCost = 5 + (dWeight * .3) + (dSize * .33) + _
(Val(sZone) * .5)
DelDate = DelDate + 1
Case "Second-Day Air"
dCost = 4 + (dWeight * .3) + (dSize * .2) + _
(Val(sZone) * .3)
DelDate = DelDate + 2Case "Ground"
dCost = 3 + (dWeight * .18) + (dSize * .1) + _
(Val(sZone) * .1)
DelDate = DelDate + 2 + Int(Val(sZone) * .8)
End Select
End SelectsCost = Format(dCost, "Currency")
Outputs.SetProperty "Cost", sCost
Outputs.SetProperty "Delivery Date", DelDate
iReturn = CancelOperationEnd If
Service_PreInvokeMethod = iReturn
End Function
See Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference Published: 18 June 2003 |