Siebel Object Interfaces Reference > Interfaces Reference > Business Component Events >

BusComp_PreWriteRecord Event


The PreWriteRecord event is called before a row is written to the database. The event can perform any final validation necessary before any internal record-level validation is performed.

Syntax

BusComp_PreWriteRecord

Argument
Description

Not applicable

 

Returns

ContinueOperation or CancelOperation

Usage

CancelOperation stops the execution of the underlying Siebel code associated with the event. However, if there is code in the same script following CancelOperation, that code runs regardless of the CancelOperation.

The PreWriteRecord event triggers only if a field value was modified or inserted, or when a record is deleted. When a record is deleted, PreWriteRecord is called to delete the implied join records to the initial record.

When associating a multivalue group record (based on an M:M relationship) with the business component that invokes the association, the PreWriteRecord and WriteRecord events execute. These events execute even if no fields on the base or invoking business component are updated by the association. The PreWriteRecord and WriteRecord events are executed to acknowledge the update to the intersection table.

CAUTION:  Be careful when using the Raise Error and RaiseErrorText methods in BusComp_PreWriteRecord, because they cancel operations. For example, if RaiseErrorText is used in BusComp_PreWriteRecord, the user or code will not be able to step off the current record until the condition causing the RaiseErrorText method to be invoked is addressed.

Used With

Server Script

Example

Function BusComp_PreWriteRecord As Integer

   ' This code resets the probability before the write
   ' if necessary

   if Me.GetFieldValue("Sales Stage") LIKE "07*" then
      ' Resets the Probability to 75 if less than 75
      if Val(Me.GetFieldValue("Rep %")) < 75 then
         Me.SetFieldValue "Rep %", "75"
      end If
   end if

   BusComp_PreWriteRecord = ContinueOperation
End Function

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.