Skip to content

Insert letter request

This shared, base-class operation builds and executes a stored-procedure call to insert a pending letter-request record for a legal case and returns the generated request sequence number. It is a support operation called by Print DEF letter and Save hearing request / update case.

Field Value
Operation ID OP-LGL-002
Trigger Called by clsScheduleManager.PrintDEF (DEF letter) or clsRequestManager.OnWrite (recon-request letter, SendReconRequest)
Inputs letterTypeCode (5 chars), legal case number, claim ID, hold date, create user
Outputs requestNum — generated letter-request sequence number
Primary components LegalManagerBase.insertLetterRequest
Entry point SAIF.Application.Claim.Legal\LegalManagerBase.vb

Steps

  1. Build an IDataRequest with CommandType = StoredProcedure and SQLStatement = "pk80001_LEGALNET.insertLetterRequest" (SQL-001).
  2. Bind parameters onto the request:
  3. letterTypeCode (5 characters)
  4. aLegalCaseNum
  5. holdDate — nullable date; sent as DbType.Date (NULL) when the caller passes Date.MinValue, otherwise the actual date value
  6. createUser (30 characters)
  7. aClaimId
  8. requestNum — bound as an InputOutput parameter
  9. Execute the request via DPI.DataAccessLayer.ProcessPortalRequest (SQL-001).
  10. On failure: the underlying data-access exception propagates to the caller (no local catch in this operation).
  11. Read the output requestNum parameter from the completed portal request and return it as the generated letter-request sequence number.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Caller supplies letter type/case/claim/hold date]) --> Build[Build IDataRequest<br>StoredProcedure call]
    Build --> Bind[Bind parameters<br>via insertLetterRequest]
    Bind --> Exec[ProcessPortalRequest]
    Exec --> Read[Read requestNum output parameter]
    Read --> EndOk([Return requestNum])

Failure and edge-case behavior

  • holdDate = Date.MinValue: sent to Oracle as a NULL date rather than a literal minimum-date value.
  • Data-access failure during ProcessPortalRequest: propagates unhandled to the calling operation (Print DEF letter or Save hearing request / update case).

Sources

  • SAIF.Application.Claim.Legal\LegalManagerBase.vb