Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

FirstSelected Method

FirstSelected moves the focus to the first record of the multiple selection in the business component, invoking any associated Basic events.




Not applicable



An integer in Siebel VB: 1 or nonzero if there was a first record (the query returned results) and 0 if there are no records; a Boolean in ActiveX, COM, and Siebel eScript.

Used With

COM Data Server, Server Script


The following examples show how the FirstSelected method could be used in conjunction with the NextSelected method to provide custom multirecord deletion functionality. This code could be triggered in respect to the user invoking the Delete Selected custom method, when pressing a custom button on an applet.

The following example is in Siebel eScript:

function BusComp_PreInvokeMethod (MethodName)
   if (MethodName == "Delete Selected")
      with (this)
         var iRecord = FirstSelected();

         while (iRecord)
            iRecord = NextSelected();


      return (CancelOperation);

   return (ContinueOperation);

The following example is in Siebel VB:

Function BusComp_PreInvokeMethod (MethodName As String) As Integer

   Dim iRtn As Integer

   iRtn = ContinueOperation
   If MethodName = "Delete Selected" Then

      With me
         Dim iRecord As Integer

         iRecord = .FirstSelected

         While iRecord
            iRecord = .NextSelected

      End With

      iRtn = CancelOperation

   End If

   BusComp_PreInvokeMethod = iRtn
End Function

Siebel Object Interfaces Reference