BusComp_PreDeleteRecord Event

If Siebel CRM detects that the user is about to delete a business component record, then it calls the BusComp_PreDeleteRecord event. You can use this event to prevent the deletion or to perform any actions before Siebel CRM deletes the record.This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler.

Format

BusComp_PreDeleteRecord

No arguments are available.

Usage

Usage for the BusComp_PreDeleteRecord event is the same as usage for the BusComp_DeleteRecord event. For more information, see Usage for the BusComp_DeleteRecord Event in BusComp_DeleteRecord Event.

Used With

Server Script

Examples

The following Siebel VB example prevents the deletion of an account that includes associated opportunities:

(general)
(declarations)
Option Explicit

Function BusComp_PreDeleteRecord As Integer
   Dim oBC as BusComp
   Dim oBO as BusObject
   Dim sAcctRowId as string

   sAcctRowId = me.GetFieldValue("Id")
   set oBO = TheApplication.GetBusObject("Opportunity")
   set oBC = oBO.GetBusComp("Opportunity")

   With oBC
      .SetViewMode AllView
      .ClearToQuery
      .SetSearchSpec "Account Id", sAcctRowId
      .ExecuteQuery ForwardOnly
      If (.FirstRecord = 1) Then
         RaiseErrorText("Opportunities exist for the Account - _
            Delete is not allowed")
      End If
   End With

   BusComp_PreDeleteRecord = ContinueOperation

   Set oBC = Nothing
   Set oBO = Nothing

End Function