---
title: clsProducerCollection
summary: API reference for clsProducerCollection.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Agency
reference_type: package
---

# clsProducerCollection

`clsProducerCollection` is the BOF collection façade for producer retrieval and filtering. It loads producer rows from `AGENT`, supports active and LOV-eligible subsets, and can be created empty for agency bulk-loading scenarios.

## Purpose
- Retrieve all producers or only the producers for one agency.
- Provide in-memory active and LOV-eligible producer subsets.
- Support bulk-loading workflows that require a fresh empty producer collection.

## Context
- Namespace: `SAIF.Business.Policy.Agency`
- Assembly/package: `SAIF.Business.Policy.Agency`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `Item` (index) | `Default Public ReadOnly Property Item(ByVal Index As Integer) As clsProducer` | Returns the producer at the given zero-based position in the collection. |
| `Item` (agent number) | `Default Public ReadOnly Property Item(ByVal inAgentNumber As Decimal) As clsProducer` | Looks up a producer in the collection by its agent number. |
| `CurrentItem` | `Public Shadows ReadOnly Property CurrentItem() As clsProducer` | Returns the producer at the collection's current cursor position, typed as `clsProducer` rather than the base collection's untyped current item. |
| `Active` | `Public ReadOnly Property Active(ByVal inDate As Date) As clsProducerCollection` | Returns only producers active on the requested date. |
| `NotExcludedFromListOfValues` | `Public ReadOnly Property NotExcludedFromListOfValues() As clsProducerCollection` | Returns only producers eligible for LOV-driven selection. |
| `Add` | `Public Shadows Function Add(ByVal inProducer As clsProducer) As Integer` | Adds a producer to the collection and returns its list position. |
| `Contains` (producer) | `Public Overloads Function Contains(ByVal inProducer As clsProducer) As Boolean` | Reports whether a producer instance is already present. |
| `Contains` (agent number) | `Public Overloads Function Contains(ByVal inAgentNumber As Decimal) As Boolean` | Reports whether a producer with the given agent number is already present. |
| `ContainsDeleted` (producer) | `Public Overloads Function ContainsDeleted(ByVal inProducer As clsProducer) As Boolean` | Reports whether a producer instance is present in the deleted-items set. |
| `ContainsDeleted` (agent number) | `Public Overloads Function ContainsDeleted(ByVal inAgentNumber As Decimal) As Boolean` | Reports whether a deleted producer matching the given agent number is present in the deleted-items set. |
| `Remove` (producer) | `Public Sub Remove(ByVal inProducer As clsProducer)` | Removes a specific producer instance from the collection. |
| `Remove` (agent number) | `Public Sub Remove(ByVal inAgentNumber As Decimal)` | Removes a producer by identity from the collection. |
| `NewProducerCollection` | `Public Shared Function NewProducerCollection(ByVal inDataportal As IDataPortalInfo) As clsProducerCollection` | Creates an empty producer collection used by bulk-load reset logic. |
| `GetProducerCollection` (all) | `Public Shared Function GetProducerCollection(ByVal inDataportal As IDataPortalInfo) As clsProducerCollection` | Retrieves every producer row across all agencies. |
| `GetProducerCollection` (by agency) | `Public Shared Function GetProducerCollection(ByVal inDataportal As IDataPortalInfo, ByVal inAgencySeqNum As Decimal) As clsProducerCollection` | Retrieves all producers belonging to a single agency. |

## Inherited public members

Members in this section are inherited from `clsBusinessCollectionBase` in `SAIF.Framework.Core`. They are available on this type through inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| `First` | `Sub First()` | Moves the collection cursor to the first producer.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Last` | `Sub Last()` | Moves the collection cursor to the last producer.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Next` | `Sub Next()` | Advances the collection cursor.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Previous` | `Sub Previous()` | Moves the collection cursor backward.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `SetCurrent` | `Sub SetCurrent(item As Object)` | Assigns the current-item position used by BOF traversal helpers.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Traverse` | `Sub Traverse(inDirection As TraverseDirection)` (via `ITraversion`) | Advances the cursor according to a supplied direction/step.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Error` | `ReadOnly Property Error As String` (via `IDataErrorInfo`) | Returns a summary validation-error message aggregated across collection items.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `Item(columnName)` | `ReadOnly Property Item(columnName As String) As String` (via `IDataErrorInfo`) | Returns a per-property validation-error message for the collection.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `DeletedCollection` | `Protected Class DeletedCollection` (inherits `CollectionBase`) | Tracks items removed from the collection for inclusion in save/delete operations.* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |
| `SortDirection` | `ReadOnly Property SortDirection() As ListSortDirection` | Returns the direction of the most recent sort.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |
| `SortProperty` | `ReadOnly Property SortProperty() As String` | Returns the name of the property the collection is currently sorted by.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |
| `Sort` / `SortMulti` | `Sub Sort(aProp As String, [aDir As ListSortDirection = Ascending], [stable As StableSortSetting = Default])` / `Sub SortMulti(aParms() As SortParm)` | Sorts the collection by one property, or by multiple properties in sequence using a stable sort.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |
| `Find` / `FindMulti` / `BinarySearch` | `Function Find(aProp As String, aKey As Object) As Integer` / `Function FindMulti(aParms() As FindParm) As Integer` / `Function BinarySearch(aProp As String, aKey As Object) As Integer` | Locates an item by one or more property/value pairs, or by binary search on an already-sorted collection.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |
| `Shuffle` | `Sub Shuffle()` | Randomizes item order.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |
| `RemoveLinks` / `LinkItems` | `Sub RemoveLinks()` / `Sub LinkItems()` | Manages a doubly linked list across `ILinkItem` children so siblings can reference each other.* | `SAIF.Framework.Core` — `clsSortableCollectionBase` |

## Behavioral notes
- The parameterless retrieval path reads all producer rows.
- `NewProducerCollection` is used internally by agency bulk-loading logic to reset child collections without issuing SQL.

## Constraints and usage notes
- The collection is retrieve-only; it does not implement persistence behavior.

> **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.Policy.Agency\clsProducerCollection.vb`
