SetCurrentObject method (WinStudio scripts)

Applies To

IWSIDOCollection interface

Definition

Makes an object in an IDO collection, specified by index number, the current object and returns a Boolean value indicating whether the operation was successful.

Syntax

object.SetCurrentObject( long )

Part Description
object Required. A reference to a valid IDO collection object.
long Required. A long integer indicating the index number of an object in the collection.

Remarks

A return value of:

  • TRUE indicates that the current object's index number is set.
  • FALSE indicates that the current object's index number was not set.

This method makes a specified object current without the associated processing that would normally occur, such as updating components bound to data in the collection.

Sub Main()
   Dim i As Integer
   If i < ThisForm.PrimaryIDOCollection.GetNumEntries() - 1 And _
         ThisForm.PrimaryIDOCollection.IsObjectPropertyModified("EntityCode", i) And _
         ThisForm.PrimaryIDOCollection.IsObjectPropertyModified("AccountNo", i) And _
         Not ThisForm.PrimaryIDOCollection.IsObjectPropertyModified("PaymentType", i) Then
      ThisForm.PrimaryIDOCollection.SetCurrentObject(i)
      ThisForm.SetFocus("PaymentTypeGridCol")
   End If
End Sub