---
title: clsProvider
summary: API reference for clsProvider.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Business.View.Provider
reference_type: package
---

# clsProvider

API reference for clsProvider.

## Purpose
- Core provider business object (implements `iPayee`) representing a single provider record identified by provider ID or primary tax ID.
- Nested `Criteria` class implements `IBusinessCriteria`, supplying full Create/Retrieve/Update/Delete SQL consumed through the standard BOF data-portal lifecycle.

## Context
- Namespace: `SAIF.Business.View.Provider`
- Assembly/package: `SAIF.BOF.Business.View.Provider`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ProviderID | `ReadOnly Property ProviderID() As Decimal` | Return the unique ID for this provider. |
| PrimaryTaxID | `ReadOnly Property PrimaryTaxID() As String` (implements `iPayee.SSNTaxID`) | Return the primary tax ID for this provider. |
| FormattedPrimaryTaxID | `ReadOnly Property FormattedPrimaryTaxID() As String` | Return the display-formatted primary tax ID. |
| RegisteredName | `ReadOnly Property RegisteredName() As String` (implements `iPayee.Name`) | Return the registered name associated with the provider's primary tax ID. |
| PrimaryLocation | `ReadOnly Property PrimaryLocation() As clsProviderLocation` | Return the location flagged `IsPrimaryLocation`, or the first location if none is flagged, or `Nothing` if the provider has no locations. |
| ProviderLocations | `ReadOnly Property ProviderLocations() As clsProviderLocationCollection` | Lazily retrieve and cache the collection of locations for this provider's `ProviderID`. |
| TaxIDs | `ReadOnly Property TaxIDs() As clsProviderTaxIDCollection` | Lazily retrieve and cache the collection of tax ID records for this provider's `ProviderID`. |
| PayeeAddress | `ReadOnly Property PayeeAddress() As clsAddress` (implements `iPayee.Address`) | Return the address of the active tax ID record effective today for the primary location's primary tax ID, falling back to the primary location's payment address when no matching tax ID record is found. |
| PayeeID | `ReadOnly Property PayeeID() As String` (implements `iPayee.PayeeID`) | Return `ProviderID` converted to a string. |
| PayeePhoneNumber | `ReadOnly Property PayeePhoneNumber() As String` (implements `iPayee.PhoneNumber`) | Return the phone number from the primary location's payment address. |
| PayeeEmailAddress | `Property PayeeEmailAddress As String` (implements `iPayee.EmailAddress`) | Get or set the payee email address (auto-implemented; not populated from retrieval). |
| PayeeType | `ReadOnly Property PayeeType() As iPayee.PayeeTypes` (implements `iPayee.PayeeType`) | Return `iPayee.PayeeTypes.Provider`. |
| PayeeTypeCode | `ReadOnly Property PayeeTypeCode() As String` (implements `iPayee.PayeeTypeCode`) | Return the constant `"PROV"`. |
| GetFormattedTaxID(inDPI, inTaxID) | `Shared Function GetFormattedTaxID(ByVal inDPI As IDataPortalInfo, ByVal inTaxID As String) As String` | Retrieve the provider for `inTaxID` and return its `FormattedPrimaryTaxID`. |
| GetProvider(inDataportal, inProviderID) | `Shared Function GetProvider(ByVal inDataportal As IDataPortalInfo, ByVal inProviderID As Decimal) As clsProvider` | Retrieve a provider by `ProviderID` through [SQL-003](../../sql/SQL-003-saif-business-view-provider.md); the returned instance has `ReadOnly = True`. |
| GetProvider(inDataportal, inPrimaryTaxID) | `Shared Function GetProvider(ByVal inDataportal As IDataPortalInfo, ByVal inPrimaryTaxID As String) As clsProvider` | Retrieve a provider by `PrimaryTaxID` through [SQL-004](../../sql/SQL-004-saif-business-view-provider.md); the returned instance has `ReadOnly = True`. |
| Equals(objA, objB) | `Overloads Shared Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean` | Compare two `clsProvider` instances for equality by delegating to the instance overload; returns `False` if either argument is not a `clsProvider`. |
| Equals(inObject) | `Overloads Overrides Function Equals(ByVal inObject As Object) As Boolean` | Compare this instance to an arbitrary object, delegating to the strongly typed overload when `inObject` is a `clsProvider`. |
| Equals(inObject) | `Overloads Function Equals(ByVal inObject As clsProvider) As Boolean` | Compare this provider to another `clsProvider` by `ProviderID`. |
| GetHashCode() | `Overrides Function GetHashCode() As Integer` | Return a hash code based on `ProviderID`. |
| ToString() | `Overrides Function ToString() As String` | Return `ProviderID` formatted as a string. |

## Behavioral notes
- Retrieval builds `RETRIEVE_SQL` (documented by [SQL-003](../../sql/SQL-003-saif-business-view-provider.md)) or the primary-tax-ID variant (documented by [SQL-004](../../sql/SQL-004-saif-business-view-provider.md)), selected by the nested `Criteria.CriteriaRetrieveType`.
- `Rule_ValidPrimaryTaxId` enforces that `PrimaryTaxID` parses to a 9-digit numeric value.
- Nested `Criteria` throws `ApplicationException` from `CreateSQL`, `InsertSQL`, `UpdateSQL`, and `DeleteSQL`, so `clsProvider` is retrieve-only.

## Constraints and usage notes
- Instances are constructed only through `GetProvider(...)`; the `Protected Friend` constructors and `Load(...)` method are not part of the public surface.
- `PayeeAddress` depends on `PrimaryLocation` and `TaxIDs` being populated and can raise an exception if no active address can be resolved.

## Inherited members (from clsBusinessBase)

This type inherits the following public surface from clsBusinessBase (`Legacy\BusinessObjectFramework\clsBusinessBase.vb`), in addition to the members listed above:

| Member | Signature | Purpose |
| --- | --- | --- |
| MyGuid | `ReadOnly Property MyGuid() As String` | Returns the internal GUID that uniquely identifies this in-memory object instance. |
| IsNew | `ReadOnly Property IsNew() As Boolean` | Indicates whether the object has not yet been persisted. |
| IsDeleted | `ReadOnly Property IsDeleted() As Boolean` | Indicates whether the object is marked for deletion. |
| IsDirty | `Overridable ReadOnly Property IsDirty() As Boolean` | Indicates whether the object (or a child) has unsaved changes. |
| IsValid | `Overridable ReadOnly Property IsValid() As Boolean` | Indicates whether the object currently has no broken validation rules. |
| ValidateOnDelete | `Property ValidateOnDelete As Boolean` | Controls whether validation rules run before a delete operation. |
| Rules | `ReadOnly Property Rules() As clsRulesManager` | Returns the rules manager that tracks broken rules for this object. |
| ErrorCount | `ReadOnly Property ErrorCount() As Integer` | Returns the number of broken error-severity rules. |
| ErrorMessages | `ReadOnly Property ErrorMessages() As String()` | Returns the text of all broken error-severity rules. |
| WarningCount | `ReadOnly Property WarningCount() As Integer` | Returns the number of broken warning-severity rules. |
| WarningMessages | `ReadOnly Property WarningMessages() As String()` | Returns the text of all broken warning-severity rules. |
| InformationalCount | `ReadOnly Property InformationalCount() As Integer` | Returns the number of broken informational-severity rules. |
| InformationalMessages | `ReadOnly Property InformationalMessages() As String()` | Returns the text of all broken informational-severity rules. |
| BeginEdit | `Sub BeginEdit()` | Begins an editable transaction, snapshotting current field values. |
| CancelEdit | `Sub CancelEdit()` | Rolls back field values to the last `BeginEdit` snapshot. |
| ApplyEdit | `Sub ApplyEdit()` | Commits the current edit transaction, discarding the rollback snapshot. |
| Delete | `Sub Delete()` | Marks the object for deletion on the next save. |
| Save | `Overridable Function Save() As Boolean` | Persists the object (insert, update, or delete) through the BOF data portal, if valid. |
| SaveChild | `Overridable Function SaveChild() As Boolean` | Persists the object as a child of a parent object/collection. |
| Clone | `Function Clone() As Object` | Returns a deep copy of the object. |
| XMLElementName | `Property XMLElementName() As String` | Gets or sets the XML element name used when serializing this object. |
| GetDataset | `Sub GetDataset(ByRef inDS As DataSet)` | Populates a `DataSet` with the object's field values. |
| GetDataset (named table) | `Sub GetDataset(ByRef inDS As DataSet, ByVal inTableName As String)` | Populates a `DataSet` table with the given name with the object's field values. |
| GetReportXML | `Function GetReportXML(ByVal inElementName As String) As String` | Returns an XML fragment representing the object using the supplied element name. |
| GetReportXML (default name) | `Function GetReportXML() As String` | Returns an XML fragment representing the object using the default XML element name. |
| ToXml | `Function ToXml() As String` | Serializes the object to XML using the default element name. |
| ToXml (named tag) | `Function ToXml(ByVal inTagName As String) As String` | Serializes the object to XML using the supplied tag name. |
| PreviousLinkItem / NextLinkItem | `ReadOnly Property PreviousLinkItem() As ILinkItem` / `ReadOnly Property NextLinkItem() As ILinkItem` | Returns the adjacent linked-list item for collection traversal. |
| SetValueOnChange | `Function SetValueOnChange(Of T)(ByRef inFieldValue As T, ByVal inSetValue As T, Optional ByVal inMarkDirty As Boolean = True) As Boolean` | Sets a backing field only when the value changes, optionally marking the object dirty. |

## Sources
- `Business\SAIF.Business.View.Provider\clsProvider.vb`
