---
title: clsUserSecurityQuestionCollection
summary: API reference for clsUserSecurityQuestionCollection.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.External.Users
reference_type: package
---

# clsUserSecurityQuestionCollection

`clsUserSecurityQuestionCollection` is a BOF collection class that holds a typed set of `clsUserSecurityQuestion` instances. It is defined as a separate top-level class in the same source file as `clsUserSecurityQuestion` and provides factory methods for retrieving a user's security questions or all available question codes.

## Purpose
- Provide a typed collection of `clsUserSecurityQuestion` records.*
- Expose factory methods for user-specific question retrieval and global question-code lookups.*

## Context
- Namespace: `SAIF.Business.External.Users`*
- Assembly/package: `SAIF.BOF.Business.External.Users`
- Base class: `clsBusinessCollection(Of clsUserSecurityQuestion)` (from `SAIF.BOF.Framework`)*
- Defined in: `clsUserSecurityQuestion.vb` (same source file)

## Public members

| Member | Signature | Purpose |
| --- | --- | --- |
| `HasExpiredQuestion` | `Public ReadOnly Property HasExpiredQuestion As Boolean` | Gets or sets the has expired question.* |
| `GetUserSecurityQuestionsByUserID` | `Public Shared Function GetUserSecurityQuestionsByUserID(ByVal inDPI As IDataPortalInfo, ByVal inUserID As Decimal, Optional inCultureCode As String = "en") As clsUserSecurityQuestionCollection` | Retrieves security question/answer records for a specific user ([SQL-028](../../sql/SQL-028-saif-business-external-users.md)).* |
| `GetAllSecurityQuestions` | `Public Shared Function GetAllSecurityQuestions(ByVal inDPI As IDataPortalInfo, Optional inCultureCode As String = "en") As clsUserSecurityQuestionCollection` | Retrieves all non-expired security question codes available for selection ([SQL-029](../../sql/SQL-029-saif-business-external-users.md)).* |
| `Add` | `Public Overrides Function Add(Item As clsUserSecurityQuestion) As Integer` | Executes the `Add` operation.* |

## Inherited public members

Members in this section are inherited from BOF framework base types whose package/source files are present in this repository.

Additional data-binding members inherited through `clsBindableCollectionBase` could not be verified because that source file is not present in this repository.**

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| `MyGuid` | `Public ReadOnly Property MyGuid() As String` | Returnst he unique GUID for this object. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `ItemByGuid` | `Public ReadOnly Property ItemByGuid(ByVal inGuid As String) As clsBusinessBase` | Gets or sets the item by guid.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `Contains` | `Public Function Contains(ByVal Item As clsBusinessBase) As Boolean` | Used to see if the collection contains a specific child object. Only the 'active' list of child objects is checked. Business collections also contain deleted objects, which are not checked by this call. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `ContainsDeleted` | `Public Function ContainsDeleted(ByVal Item As clsBusinessBase) As Boolean` | Used to see if the collection contains a reference to a child object that is marked for deletion. This scans the list of child objects that have been marked for deletion. If this object is in that list, the method returns True. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `Rules` | `Public ReadOnly Property Rules() As clsRulesManager` | Gets or sets the rules.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `ErrorCount` | `Public ReadOnly Property ErrorCount() As Integer` | Gets or sets the error count.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `ErrorMessages` | `Public ReadOnly Property ErrorMessages() As String()` | Gets or sets the error messages.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `WarningCount` | `Public ReadOnly Property WarningCount() As Integer` | Gets or sets the warning count.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `WarningMessages` | `Public ReadOnly Property WarningMessages() As String()` | Gets or sets the warning messages.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `InformationalCount` | `Public ReadOnly Property InformationalCount() As Integer` | Gets or sets the informational count.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `InformationalMessages` | `Public ReadOnly Property InformationalMessages() As String()` | Gets or sets the informational messages.* | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `BeginEdit` | `Public Sub BeginEdit()` | Starts a nested edit on the object. When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling clsBusinessBase.CancelEdit or committed by calling clsBusinessBase.ApplyEdit. This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack. This method triggers the copying of all child object states. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `CancelEdit` | `Public Sub CancelEdit()` | Cancels the current edit process, restoring the object's state to its previous values. Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last call. This method triggers an undo in all child objects. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `ApplyEdit` | `Public Sub ApplyEdit()` | Commits the current edit process. Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last This method triggers an ApplyEdit in all child objects. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `Add` | `Public Sub Add(ByVal inChild As clsBusinessBase)` | Adds a child object to the collection. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `Remove` | `Public Sub Remove(ByVal inChild As clsBusinessBase)` | Removes a child object from the collection. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `Item` | `Default Public ReadOnly Property Item(ByVal index As Integer) As clsBusinessBase` | Returns a reference to a child object in the collection. | `SAIF.BOF.Framework` — `clsBusinessCollectionBase` |
| `BinarySearch` | `Public Function BinarySearch(ByVal aProp As String, ByVal aKey As Object) As Integer` | Executes the `BinarySearch` operation.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `Find` | `Public Overridable Function Find(ByVal aProp As String, ByVal aKey As Object) As Integer` | This method serves as a usable Find method but recognize that you do not have to call this method in order to find an item in the collection. Finding is done by the IBindingList_Find method. In a typical app the developer would either have to create a similar method or create the PropertyDescriptor needed by IBindingList_Find. This method takes care of all that and also verifies that there are items in the collection before calling IBindingList_Find. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `FindMulti` | `Public Overridable Function FindMulti(ByVal aParms() As FindParm) As Integer` | This method serves as a usable Find method but recognize that you do not have to call this method in order to find an item in the collection. This is a specialized version however and supports finding on multiple properties. The IBindingList_Find method searches for a match between a single property and value. It also searches from the beginning of a collection each time so it cannot be used in this situation. If you instantiate and initialize an array of find parameters (FindParm objects) FindMulti will compare each property/value pair with each item in the collection returning the index of the first item that matches all criteria or -1 if no object matches. NOTE: Currently all FindParms are tested even if one of the first ones fails. Obviously there there is no need to keep testing if one match fails. An optimization could be made to eliminate the unnecessary checks but it has not been done here. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `Shuffle` | `Public Overridable Sub Shuffle()` | Performs the `Shuffle` action.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `Sort` | `Public Overridable Sub Sort(ByVal aProp As String, Optional ByVal aDir As ListSortDirection = ListSortDirection.Ascending, _ Optional ByVal stable As StableSortSetting = StableSortSetting.Default)` | This method serves as a usable Sort method but recognize that you do not have to call this method in order to sort a collection. Sorting is done by the IBindingList_ApplySort method. In a typical app the developer would either have to create a similar method or create the PropertyDescriptor needed by IBindingList_ApplySort. This method takes care of all that and also verifies that there are items in the collection before calling IBindingList_ApplySort. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `SortMulti` | `Public Overridable Sub SortMulti(ByVal aParms() As SortParm)` | This method serves as a usable Sort method but recognize that you do not have to call this method in order to sort a collection. Sorting is done by the IBindingList_ApplySort method. In a typical app the developer would either have to create a similar method or create the PropertyDescriptor needed by IBindingList_ApplySort. This method takes care of all that and also verifies that there are items in the collection before calling IBindingList_ApplySort. A few special cases should be noted. In order to to support sorting on multple properties the StableSort routine was introduced. Using a stable sort algorithm insures that sorts on a second or third property don't move items sorted on earlier ones. Rather than write a loop in your app to call Sort over and over again this method is included. If you pass it a collection of sort parameters (SortParm objects) it will call Sort for each of them. Due to the way the IBindingList interface operates there is no record of the SortParm collection itself only the property and direction of the last sort is retained. As a result any direct call to IBindingList_ApplySort would perform the last sort again, not the entire set. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `RemoveLinks` | `Public Sub RemoveLinks()` | Removes links from all children in this collection. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `LinkItems` | `Public Sub LinkItems()` | Links all Items in the collection into a linked list. If there is only 1 item in the collection, the links are removed. This functionality allows child objects to refer to their siblings when necessary. | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `CriteriaObject` | `Public Overridable Property CriteriaObject() As IBusinessCriteria Implements IBusinessObject.CriteriaObject` | Gets or sets the criteria object.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `GetDataset` | `Public Sub GetDataset(ByRef inDS As DataSet)` | Performs the `GetDataset` action.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `GetDataset` | `Public Sub GetDataset(ByRef inDS As DataSet, ByVal inTableName As String)` | Performs the `GetDataset` action.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `ToDatasetXml` | `Public Function ToDatasetXml() As String` | Executes the `ToDatasetXml` operation.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |
| `ToDatasetXml` | `Public Function ToDatasetXml(ByVal inTableName As String) As String` | Executes the `ToDatasetXml` operation.* | `SAIF.BOF.Framework` — `clsSortableCollectionBase` |

## Behavioral notes
- `GetAllSecurityQuestions` filters out expired question codes using `NVL(EXPIRATION_DATE, sysdate+1) > sysdate`.*
- Factory methods delegate to the `IBusinessCriteria` pattern via the BOF data portal.*

## Constraints and usage notes
- Not directly instantiable by callers; use the provided `Shared` factory methods.*

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.External.Users\clsUserSecurityQuestion.vb`
- `Services\SAIF.Services.Printing.Remote\packages\SAIF.BOF.Framework.2.0.22103.3\src\SAIF.BOF.Framework.Core\V1\BaseItems\clsBusinessCollection.vb`
- `Legacy\BusinessObjectFramework\clsBusinessCollectionBase.vb`
- `Legacy\BusinessObjectFramework\clsSortableCollectionBase.vb`
- `Services\SAIF.Services.Printing.Remote\packages\SAIF.BOF.Framework.2.0.22103.3\src\SAIF.BOF.Framework.Core\V1\BaseItems\clsBusinessCollectionBase.vb`
- `Services\SAIF.Services.Printing.Remote\packages\SAIF.BOF.Framework.2.0.22103.3\src\SAIF.BOF.Framework.Core\V1\BaseItems\clsSortableCollectionBase.vb`
