WriteRecord Method for a Business Component

The WriteRecord method saves to the Siebel database any modifications made to the current record. This method does not return any information.

Format

oBusComp.WriteRecord

No arguments are available.

Usage

After creating new records and setting values for fields, you can call the Write Record method to save the new record to the Siebel database.

Used With

Browser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script

Examples

The Siebel VB example in this topic implements the following logic: if the user sets the Sales Stage field to 02, then insert an activity:

(general)
(declarations)
Option Explicit
# Sub BusComp_SetFieldValue (FieldName As String)
   ' Run this code from the Opportunities Activities view.
   ' Opportunity is presumed to be the parent business component.

   Select Case FieldName
      Case "Sales Stage"
      if Me.GetFieldValue(FieldName) LIKE "02*" Then
         ' reference the Action business component
         Dim oBCact as BusComp
         Set oBCact = me.BusObject.GetBusComp("Action")
         With oBCact
            .NewRecord NewAfter
            .SetFieldValue "Type", "Event"
            .SetFieldValue "Description", "THRU SVB, Stage _
               changed to 02"
            .SetFieldValue "Done", Format(Now(), _
               "mm/dd/yyyy hh:mm:ss")
            .SetFieldValue "Status", "Done"
            .WriteRecord
         End With
         set oBCact = Nothing
      end if
   End Select
End Sub

For more examples, see GetMVGBusComp Method for a Business Component and NewRecord Method for a Business Component