Sample Notifications Script

The notification script can be created through a button, an Excel macro, or another VB application. Because it is a script and not an application, it does not need the VB Set command. All the commands are standard to VB coding.

This script is designed to update a message without an expiration date, not to create a new message every time. For more information about how to get or create a Siebel Application Object, see Configuring Siebel Business Applications.

Note: The code in this example updates single value fields. For information about how to update multi-value fields, see Configuring Siebel Business Applications.
'Get "Broadcast Message" BusComp 
   Set BusObj = SiebelApplication.GetBusObject("Broadcast Message", errCode)
   Set BusComp = BusObj.GetBusComp("Broadcast Message", errCode)
'Find "Calls Waiting" message
   BusComp.SetSearchSpec "Abstract", "Calls In Queue", errCode
   BusComp.ExecuteQuery 0, errCode
   If BusComp.FirstRecord(errCode) <> True Then
'We need to create a new message
   BusComp.NewRecord 0, errCode
   BusComp.SetFieldValue "Abstract", "Calls In Queue", errCode
‘Prepare message using middleware API info.
   End If 
   Set Msg = "[N]Calls Waiting: [U]10"
'Update the record
   BusComp.SetFieldValue "Body", Msg, errCode
   BusComp.SetFieldValue "All", "Y", errCode
Write the record
  BusComp.WriteRecord errCode

In addition to writing a script, you can use Siebel Business Process Designer to create or update a message. For more information, see Siebel Business Process Framework: Workflow Guide.