---
title: Premium auditor lookup
summary: Resolves the premium auditor associated with an AD user ID and vendor number.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.External.Users
reference_type: package
operation_id: OP-EU-07
trigger: Caller invokes `mdlAuditor.LoadAuditor` during external-user or audit-routing workflows.
---

# Premium auditor lookup

This operation is a small but important helper: given an AD user ID, vendor number, and test-user indicator, it finds the matching premium auditor row and returns the full `clsAuditor` object.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-EU-07 |
| **Trigger** | Caller needs the premium auditor associated with a user/vendor combination |
| **Inputs** | AD user ID, vendor number, test-user flag |
| **Outputs** | Retrieved `clsAuditor` object |
| **Primary components** | `mdlAuditor.LoadAuditor` |
| **Entry point** | `Business\SAIF.Business.External.Users\mdlAuditor.vb` |

## Steps

1. **Query `PA_AUDITOR` for the exact AD user and vendor-number combination.** The helper binds `UserID` and `VendorNum` and executes the first scalar lookup ([SQL-041](../sql/SQL-041-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).
2. **Retry by vendor number only for test users.** When the first query returns no auditor ID and the caller marked the account as a test user, the helper executes the vendor-only fallback query defined in the same lookup path ([SQL-041](../sql/SQL-041-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).
3. **Hydrate the full auditor object from the resolved ID.** The helper passes the selected auditor ID into `clsAuditor.GetAuditorByAuditorID` so callers receive the standard auditor business object.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Load auditor request]) --> Exact[Query by AD user ID and vendor]
    Exact --> Found{Auditor found?}
    Found -->|Yes| Load[Load full auditor object]
    Found -->|No| Test{Test user?}
    Test -->|Yes| Fallback[Query by vendor only]
    Test -->|No| Load
    Fallback --> Load
    Load --> Done([Return auditor object])
```

## Failure and edge-case behavior

- Non-test users do not get the vendor-only fallback path.
- When neither query finds an auditor ID, the downstream `clsAuditor.GetAuditorByAuditorID` call determines what empty-object behavior the caller receives.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `Business\SAIF.Business.External.Users\mdlAuditor.vb`
- `Business\SAIF.Business.External.Users\clsAuditor.vb`
