﻿---
title: clsHelpText
summary: API reference for clsHelpText.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business
reference_type: package
---

# clsHelpText

`clsHelpText` is a public class in `SAIF.Business` that inherits `clsBusinessBase` and represents a single help-text row retrieved by reference-key value.

## Purpose
- Retrieves help text from `APPLICATION_HELP_DETAIL` for a supplied key.
- Exposes the retrieved key and help-text value on a read-only public surface.
- Provides null/empty detection, key-based equality, and a simple validity rule for retrieved help-text objects.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `HelpText` | `Public ReadOnly Property HelpText() As String` | Returns the help-text value through the backing `clsSmartString`. |
| `Key` | `Public ReadOnly Property Key() As String` | Returns the reference-key value used to identify the help text. |
| `IsHelpTextNull` | `Public Function IsHelpTextNull() As Boolean` | Returns whether the backing help-text value is empty. |
| `Equals` | `Public Overloads Shared Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean` | Returns `True` when both objects are `clsHelpText` instances with the same key. |
| `Equals` | `Public Overloads Overrides Function Equals(ByVal inObject As Object) As Boolean` | Compares this instance with another object by delegating to the typed `Equals` overload. |
| `Equals` | `Public Overloads Function Equals(ByVal inObject As clsHelpText) As Boolean` | Returns `True` when the supplied help-text object's `Key` matches this object's `Key`. |
| `GetHashCode` | `Public Overrides Function GetHashCode() As Integer` | Returns the hash code of the `Key` property. |
| `ToString` | `Public Overrides Function ToString() As String` | Returns the help-text string value. |
| `GetHelpText` | `Public Shared Function GetHelpText(ByVal inDataportal As IDataPortalInfo, ByVal inKey As String) As clsHelpText` | Retrieves a help-text object for the supplied key through the data-access layer. |
| `IsHelpTextValid` | `Public Function IsHelpTextValid(ByVal target As Object, ByVal e As clsRuleArgs) As Boolean` | Validation rule that succeeds only when `Key.Trim.Length > 0`. |

## Behavioral notes
- `BeforeRetrieve` issues a result-set query built from `MyCriteria.RetrieveSQL` and binds the `Key` parameter with length 40.
- `AfterRetrieve` fills the object only when the result set contains at least one row, then marks the object old.
- `IsHelpTextNull` delegates to `m_HelpText.IsEmpty`.
- Equality and hash-code behavior are based only on `Key`, not on the help-text body.
- `ToString` returns the current `HelpText` value, which makes the object display as the help text itself.
- `AddBusinessRules` registers `IsHelpTextValid` with the message `Error: Help text not available.`

## Constraints and usage notes
- The public surface is read-only; this source file does not expose setters for `HelpText` or `Key`.
- The criteria object supports retrieval only: its `CreateSQL`, `InsertSQL`, `UpdateSQL`, and `DeleteSQL` members all throw `ApplicationException`.
- Instances are retrieved with `GetHelpText`; the constructor is `Protected Friend`.

## Sources
- `Business\SAIF.Business\clsHelpText.vb`
