Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel Object Interfaces Reference > Interfaces Reference > Business Component Events >
BusComp_ChangeRecord
The ChangeRecord event is called after a record becomes the current row in the business component.
Syntax
BusComp_ChangeRecord
Returns
Not applicable
Usage
Code in the ChangeRecord event handler is executed each time that the focus changes to another record. Avoid lengthy operations in this event handler to enable smooth scrolling in list applets.
Used With
Server Script
Example
This Siebel VB example uses two subprograms in the (general) (declarations) section to set up an audit trail for service requests. The ChangeRecord event handler is used to initialize the values from the service record so that they can be compared with current values.
(general) (declarations)
Option Explicit
Dim OldClosedDate, OldCreated, OldOwner, OldOwnerGroup
Dim OldSeverity, OldSource, OldStatus
Declare Sub CreateAuditRecord
Declare Sub InitializeOldValuesSub CreateAuditRecord (FieldName As String, NewValue As String, OldValue As String, ChangedText As String)
Dim ActionBC As BusComp
Dim CurrentBO As BusObject
Dim theSRNumberSet CurrentBO = TheApplication.GetBusObject("Service Request")
Set ActionBC = CurrentBO.GetBusComp("Action")
theSRNumber = GetFieldValue("SR Number")With ActionBC
.ActivateField "Activity SR Id"
.ActivateField "Description"
.ActivateField "Private"
.ActivateField "Service request id"
.ActivateField "Type"
.NewRecord NewAfter.SetFieldValue "Activity SR Id", theSRNumber
.SetFieldValue "Description", ChangedText
.SetFieldValue "Private", "Y"
.SetFieldValue "Type", "Administration"
.WriteRecord
End With
End SubSub InitializeOldValues
OldClosedDate = GetFieldValue("Closed Date")
OldOwner = GetFieldValue("Owner")
OldSeverity = GetFieldValue("Severity")
If GetFieldValue("Severity") <> OldSeverity Then
NewValue = GetFieldValue("Severity")
ChangedText = "Changed Priority from " + OldSeverity + _
" to " + NewValue
CreateAuditRecord "Severity", NewValue, OldSeverity, _
ChangedText
End If
End SubSub BusComp_ChangeRecord
InitializeOldValues
End Sub
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel Object Interfaces Reference Published: 18 June 2003 |