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

# clsPolicyAffiliateBase

Shared read-only base class for policy-to-affiliate associations, including nested affiliate hydration and association identity behavior.

## Purpose
- Centralize the association key, audit fields, and nested `clsAffiliate` loading shared by interested parties and preferred workers.
- Provide common equality, dirty-state, and validity behavior for derived policy-affiliate objects.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Affiliate | `Public ReadOnly Property Affiliate() As clsAffiliate` | Person standing behind the association. The child is normally hydrated from the same joined row as the association, so reading it costs nothing; if the cached child no longer matches the association's SSN it is discarded and re-fetched so callers never see a person that belongs to a different association. |
| BusinessSequenceNumber | `Public ReadOnly Property BusinessSequenceNumber() As Decimal` | Sequence number of the underlying `BUSINESS_AFFILIATE` row, carried through so callers can tie the association back to its exact source row; it takes no part in association identity, which is the policy/SSN/effective-date triple. |
| AffiliateID | `Public ReadOnly Property AffiliateID() As String` | SSN of the person attached to the policy: one of the three values that identify the association, the join key to `AFFILIATE`, and the key used to hydrate and refresh the nested `Affiliate` child. |
| CancelDate | `Public ReadOnly Property CancelDate() As Date` | Date the person's attachment to the policy ended. An unset value means the attachment is still open, which is how window queries and the `Active` filters treat it, and it is also the upper bound the preferred-worker eligibility lookup must cover. |
| CreateDate | `Public ReadOnly Property CreateDate() As Date` | Audit stamp for when the association row was created — distinct from the person's own creation stamp on `Affiliate`, since attaching an existing person to a policy creates a new association only. |
| CreateUser | `Public ReadOnly Property CreateUser() As String` | Audit stamp naming the user or process that attached the person to the policy, used when tracing who added an interested party or preferred worker. |
| EffectiveDate | `Public ReadOnly Property EffectiveDate() As Date` | Date the person's attachment to the policy began: the third component of association identity, the value window queries compare against the requested end date, and a date the preferred-worker eligibility row must cover. |
| PolicyNumber | `Public ReadOnly Property PolicyNumber() As Decimal` | Policy the person is attached to: the first component of association identity and the filter every collection retrieval binds, so one person appears once per policy period they participate in. |
| UpdateDate | `Public ReadOnly Property UpdateDate() As Date` | Audit stamp for the most recent change to the association row, letting callers see when an attachment was last amended (for example when a cancel date was added) without inspecting the person record. |
| UpdateUser | `Public ReadOnly Property UpdateUser() As String` | Audit stamp naming the user or process that last amended the association, paired with `UpdateDate` when tracing changes to a person's role or period on the policy. |
| IsValid | `Public Overrides ReadOnly Property IsValid() As Boolean` | Passes the framework's validation verdict straight through — this hierarchy registers no rules of its own, so an association is valid whenever the BOF base considers it valid, and the nested `Affiliate` child's state does not affect the result. |
| IsDirty | `Public Overrides ReadOnly Property IsDirty() As Boolean` | Passes the framework's change-tracking verdict straight through; because the nested `Affiliate` child is not consulted, edits made to the child person do not mark the association dirty. |
| IsCancelDateNull | `Public Function IsCancelDateNull() As Boolean` | Separates an association that is still open from one cancelled on a real date — a distinction `CancelDate` alone cannot express, and the same one the date-window SQL encodes with `nvl` when deciding which associations overlap a requested period. |
| IsAffiliateTypeCodeNull | `Public Function IsAffiliateTypeCodeNull() As Boolean` | Reports that the loaded row carries no affiliate type discriminator, meaning the person's role on the policy (`1` interested party, `2` preferred worker) is unclassified in the source data. |
| Equals | `Public Overloads Shared Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean` | Type-safe comparison for call sites holding loosely typed references: matches only when both operands are policy-affiliate associations agreeing on policy, SSN, and effective date; a non-association operand fails rather than raising. |
| Equals | `Public Overloads Overrides Function Equals(ByVal inObject As Object) As Boolean` | Makes framework collection searches that pass boxed objects resolve associations by the three-part key, while refusing to match objects of any other type. |
| Equals | `Public Overloads Function Equals(ByVal inPolicyNumber As Decimal, ByVal inAffiliateID As String, ByVal inEffectiveDate As Date) As Boolean` | Tests this association against a caller-supplied key without needing a comparison object, which is how the collections locate or remove a specific person-on-a-policy-period from loose key values. |
| Equals | `Public Overloads Function Equals(ByVal inObject As clsPolicyAffiliateBase) As Boolean` | Treats two associations as the same attachment only when policy, SSN, and effective date all agree, so the same person on a different policy or a different policy period remains a distinct association. |
| GetHashCode | `Public Overrides Function GetHashCode() As Integer` | Hashes on the SSN alone even though equality uses all three key parts; every association for one person therefore shares a hash bucket, which stays correct but degrades hashed lookups for people attached to many policies or periods. |
| ToString | `Public Overrides Function ToString() As String` | Renders the full association key as `AffiliateID,PolicyNumber,EffectiveDate`, giving diagnostics and state dumps a value that identifies the specific attachment rather than just the person. |
| New | `Public Sub New()` | Creates a retrieval context with no portal or key values yet assigned, for the framework's deserialization and template construction paths. |
| New | `Public Sub New(ByVal inDataPortalInfo As IDataPortalInfo)` | Binds a retrieval context to the caller's data portal so later queries run on the caller's connection and pending transaction; the association key is supplied separately, as the collection loaders do after filling each child. |
| New | `Public Sub New(ByVal inDataPortalInfo As IDataPortalInfo, ByVal inAffiliateID As String, ByVal inPolicyNumber As Decimal, ByVal inEffectiveDate As Date)` | Binds the caller's data portal together with the complete three-part association key, making the object independently re-retrievable for exactly one person on one policy period. |

## Inherited public members

Members in this table whose Origin is `SAIF.Framework.Core` were retrieved from that library's documentation via the Legends CLI; the Origin column identifies the originating class for each member.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Rules | `Property Rules As clsRulesManager` | Exposes the BOF rules manager for inherited validation behavior. | `SAIF.Framework.Core` — `clsBusinessBase` |
| BeginEdit | `Sub BeginEdit()` | Starts an edit session so callers can stage in-memory changes before applying or cancelling them. | `SAIF.Framework.Core` — `clsBusinessBase` |
| CancelEdit | `Sub CancelEdit()` | Reverts the current edit session through the BOF edit-level mechanism. | `SAIF.Framework.Core` — `clsBusinessBase` |
| ApplyEdit | `Sub ApplyEdit()` | Commits the current edit session in memory before any save orchestration occurs. | `SAIF.Framework.Core` — `clsBusinessBase` |
| Error | `ReadOnly Property Error As String` | Surfaces the current object-level validation error text to data-binding consumers. | `SAIF.Framework.Core` — `clsBusinessBase` |
| Item(columnName) | `ReadOnly Property Item(columnName As String) As String` | Returns column-specific validation error text through `IDataErrorInfo`. | `SAIF.Framework.Core` — `clsBusinessBase` |
| DumpState | `Sub DumpState()` | Emits framework state diagnostics for troubleshooting object state. | `SAIF.Framework.Core` — `clsBusinessBase` |
| AllowCache | `Property AllowCache() As Boolean` | Controls whether the framework may cache the business object instance. | `SAIF.Framework.Core` — `clsBusinessBase` |

## Behavioral notes
- Related operations, rules, and SQL are cross-referenced from the library-level documentation.

## Constraints and usage notes
- The library exposes read-only retrieval behavior; no type in this package can persist changes through live criteria SQL.

> **Note:** Inherited-member descriptions attributed to `SAIF.Framework.Core` in the Origin column were retrieved from that library's documentation via the Legends CLI and should be reverified if the dependency version changes.

## Sources
- `Business\SAIF.Business.Policy.Affiliate\clsPolicyAffiliateBase.vb`
