Should return an instance of the class that is associated with this collection of objects. The associated class must implement the IDatabaseObjectMultipleSubclass interface.

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
IDatabaseObject ItemInstanceForSubclass(
	SQLFieldValues objFieldValues
)
Visual Basic
Function ItemInstanceForSubclass ( _
	objFieldValues As SQLFieldValues _
) As IDatabaseObject
Visual C++
IDatabaseObject^ ItemInstanceForSubclass(
	SQLFieldValues^ objFieldValues
)

Parameters

objFieldValues
Type: DatabaseObjects.SQL..::..SQLFieldValues
The database record field values that can be used to determine the type of subclass to be loaded. Do NOT call ObjectFromFieldValues() or ObjectLoad(). These functions are called after ItemInstanceForSubclass returns. from this function.

Return Value

[Missing <returns> documentation for "M:DatabaseObjects.IDatabaseObjectsMultipleSubclass.ItemInstanceForSubclass(DatabaseObjects.SQL.SQLFieldValues)"]

Examples

CopyC#
Protected Function ItemInstanceForSubclass(ByVal objFieldValues As SQL.SQLFieldValues) As IDatabaseObject Implements IDatabaseObjects.ItemInstanceForSubclass

    If objSubclassRecord("Type") = "Special" Then
        Return New SpecialisedProduct
    Else
        Return New Product
    End If

End Function

See Also