Skip to content

Latest premium history set id

Returns the current (highest) premium-history set id for a policy period.

Field Value
Operation ID op-08-max-prem-hist-set-id
Trigger Caller invokes MaxPremiumHistorySetId
Inputs IDataPortalInfo, policy number, period effective date
Outputs Decimal
Primary components PolicyInformation.MaxPremiumHistorySetId
Entry point SAIF.Business.Policy/PolicyInformation.vb

Steps

  1. inDPI.NewPortalRequest() → scalar text request with inline SQL (SQL-007): MAX(prem_hist_set_id) from PREM_HIST_SUMMARY filtered to prem_hist_type_code IN ('1','3') (BR-POL-007).
  2. Bind PolicyNumber, PolicyPeriodEffectiveDate.
  3. DPI.ProcessPortalRequest; if the result is not DBNull return CDec(...), else return 0 (BR-POL-007).

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["Caller invokes<br>MaxPremiumHistorySetId"]) --> Request["NewPortalRequest — scalar<br>text request with inline SQL"]
    Request --> Bind["Bind PolicyNumber,<br>PolicyPeriodEffectiveDate"]
    Bind --> Process["ProcessPortalRequest"]
    Process --> Check{Result is DBNull?}
    Check -->|No| ReturnDec(["Return CDec(Result)"])
    Check -->|Yes| ReturnZero(["Return 0"])

Failure and edge-case behavior

  • A NULL result is normalized to 0 via an explicit IsDBNull guard rather than throwing.

Sources

  • SAIF.Business.Policy/PolicyInformation.vb