DeleteRecord Method for a Business Component

The DeleteRecord method removes the current record from a business component. This method does not return any information.

Format

BusComp.DeleteRecord

No arguments are available.

Used With

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

Examples

This Siebel VB example deletes accounts with a status of Inactive:

Sub DeleteInactiveAccounts()
   Dim objBO as BusObject
   Dim objBC as BusComp

   Set objBO = TheApplication.GetBusObject("Account")
   Set objBC = objBO.GetBusComp("Account")
   With objBC
      .ClearToQuery
      .SetSearchSpec "Status", "Inactive"
      .ExecuteQuery ForwardBackward
      Do While .FirstRecord
         .DeleteRecord
      Loop
   End With
   Set objBC = Nothing
   Set objBO = Nothing
End Sub

Siebel CRM moves the cursor to the next record after it runs the DeleteRecord method. Do not use the NextRecord method after you use the DeleteRecord method in a loop because this configuration causes Siebel CRM to skip deleting the last record in the loop. If you use the DeleteRecord method on the last record, then the cursor points to nothing.