Every insert, update, and delete operation checks that exactly one row was affected; if RowsAffected <> 1, an error message is added to signal a contention or unexpected state.
Trigger
Completion of any AfterInsert, AfterUpdate, or AfterDelete lifecycle method across all six business objects.
Enforcement
Each After* method inspects RowsAffected and calls AddErrorMessage(...) when the count is not exactly 1. Implemented in clsXDeferredPrint.vb, clsXDeferredPrintCollection.vb, clsXDocument.vb, clsXPrintControl.vb, clsXPrintControlCollection.vb. Note: clsXDeferredPrint.AfterDelete has its contention check commented out — no live post-delete validation applies for single-item deferred print deletes.*
Outcome
The calling layer receives an error condition when a write does not affect exactly one row, enabling the consumer to handle concurrency conflicts or data-integrity violations.
A deferred print item is eligible for retrieval when its PrintedDate is before a supplied cutoff date, or when its CreateDate is more than 30 days old — regardless of print status.
Trigger
Retrieval of clsXDeferredPrintCollection using RetrieveType = byDate.
Enforcement
clsXDeferredPrintCollection.Criteria.New(inDataportal, inPrintedDate) computes ThirtyDaysAgoDate = Today.AddDays(-30). BeforeRetrieve appends WHERE PRINTED_DATE < :PrintedDate OR CREATE_DATE < :ThirtyDaysAgoDate to the base RetrieveSQL text (SQL-010, Variant A).
Outcome
Stale or previously processed items become selectable for cleanup or reprocessing regardless of their current print status.
A print-control batch is selected for the pending-processing collection when PROCESSED_DATE < :ProcessedDate or CREATE_DATE < :ThirtyDaysAgoDate (30-day-old default).
Trigger
Retrieval of clsXPrintControlCollection via GetXprintControlCollection(inProcessedDate).
Enforcement
clsXPrintControlCollection.Criteria.New sets ThirtyDaysAgoDate = Today.AddDays(-30). BeforeRetrieve binds both date parameters to SQL-014 (WHERE PROCESSED_DATE < :ProcessedDate OR CREATE_DATE < :ThirtyDaysAgoDate).
Outcome
Both explicitly unprocessed batches (by processed date) and stale batches (by create date, regardless of processed status) are included in the pending collection, enabling cleanup of abandoned batches.
clsXPrintControl.DuplexMode translates between the DuplexModes enum (DEFLT, HORIZONTAL, VERTICAL, SIMPLEX) and fixed 5-character database codes (DEFLT, HORIZ, VERTL, SIMPL). Any stored code not matching these four values has no explicit getter return.**
Trigger
Reading or writing clsXPrintControl.DuplexMode property; inserting or updating XPRINT_CONTROL.DUPLEX_CODE.
Enforcement
The DuplexMode property getter maps stored codes to enum values via Select Case; an unrecognized code falls through with no Return, yielding an implicit VB default.** The setter translates the enum to a fixed code string for DuplexCode storage. Controlled vocabulary also appears on clsXDocument.DuplexCode and clsXDeferredPrint.DuplexCode (stored as the same 5-character codes but without explicit translation logic in those classes).*
Outcome
Only the four defined duplex modes are reliably persisted and retrieved. An unrecognized stored code may result in an implicit default enum value (SIMPLEX, ordinal 0) rather than an explicit error.**
New clsXDocument instances default XBinTypeCode to "AUTO" and CopiesCount to 1, routing to an auto-selected print bin and printing a single copy unless explicitly overridden.
Trigger
Invocation of clsXDocument.Create() lifecycle method.
Enforcement
The Create() method sets XBinTypeCode = "AUTO" and CopiesCount = 1 before any caller-supplied values are applied. These defaults flow into SQL-006 via the :XBinTypeCode and :CopiesCount parameters in BeforeInsert.
Outcome
Documents that do not explicitly set a bin type or copy count are routed to the auto-selected bin with a single copy, preventing null or zero values from reaching the database.
clsXPrintControl.IDMPathName defaults to "PROMPT", indicating that a document imaging (IDM) destination path is not pre-set and must be resolved or prompted by a downstream consumer.**
Trigger
Construction or creation of a clsXPrintControl instance without an explicit IDMPathName value.
Enforcement
The IDMPathName property (or its backing field) is initialized to "PROMPT" in the object's create/initialization path.* The "PROMPT" value flows into SQL-007 via :IDMPathName when BeforeInsert runs.
Outcome
Downstream consumers that read IDMPathName = "PROMPT" are expected to substitute a real IDM path; an unresolved "PROMPT" value in the database indicates an incomplete or pending imaging setup.**
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.