---
id: object/codeunit/3326
type: object
title: Codeunit 3326 "PA Test Fixtures"
summary: Codeunit 3326 "PA Test Fixtures" in PayablesAgent (Microsoft.Agent.PayablesAgent). 18 public procedures. Introduced in BC30.
tier: official
language: en
tags:
  - codeunit
  - payablesagent
versions:
  introduced: "30"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-12-01T01:00:51.425Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 5ee2935817e57522b9136bc477465513709c5ffb68e79326cf4e4ae543fc6870
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671/src/Apps/W1/PayablesAgent/app/TestSupport/PATestFixtures.Codeunit.al
    title: src/Apps/W1/PayablesAgent/app/TestSupport/PATestFixtures.Codeunit.al (main)
    date: null
    commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/14327
    - change/bcapps/13361
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/ai-test-copilot-agent-tests
      title: Write agent tests
      label: possibly related
      why: Test fixtures support writing agent tests for the Payables Agent using the AI Test Suite framework.
      by: model
object_type: codeunit
object_id: 3326
name: PA Test Fixtures
namespace: Microsoft.Agent.PayablesAgent
app: PayablesAgent
extends: null
first_version: "30"
last_version: "30"
present_in:
  - "30"
changed_in: []
source_major: "30"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 33
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 0
  implements: 0
---

# Codeunit 3326 "PA Test Fixtures"

> Codeunit 3326 "PA Test Fixtures" in PayablesAgent (Microsoft.Agent.PayablesAgent). 18 public procedures. Introduced in BC30.

PayablesAgent · Microsoft.Agent.PayablesAgent · BC30 · [source at f53bb0f1](https://github.com/microsoft/BCApps/blob/f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671/src/Apps/W1/PayablesAgent/app/TestSupport/PATestFixtures.Codeunit.al) · facts from BC30

## Properties

| Property | Value |
|---|---|
| Access | Internal |
| Permissions | tabledata Agent = RD, tabledata "Agent Task" = R, tabledata "Payables Agent Setup" = RIM, tabledata "Payables Agent Work Item" = ID, tabledata "Email Inbox" = I |

## Procedures

- `EnsureActivatedAndReceivePdf(FileName: Text; PdfInStream: InStream; var WorkItem: Codeunit "PA Work Item"): Boolean` (internal)
- `SelectVendor(AgentTaskId: BigInteger; VendorName: Text; var ErrorText: Text): Boolean` (internal)
- `SelectAccount(AgentTaskId: BigInteger; AccountCode: Text; var ErrorText: Text): Boolean` (internal)
- `IsReviewOfTaskResult(AgentTaskId: BigInteger; ReviewRecordId: RecordId): Boolean` (internal)
- `GetCreateVendorSuggestionCode(): Code[20]` (internal)
- `GetTaskInfotipSources(AgentTaskId: BigInteger; var Sources: JsonArray)` (internal)
- `GetWorkItemInfotipSources(WorkItemId: Guid; var Sources: JsonArray)` (internal)
- `PrepareEvaluationVersion(Version: Integer)` (internal)
- `GetPreparedEvaluationVersion(): Integer` (internal)
- `ResetEvaluationState()` (internal)
- `DeleteAllTaskAndEDocumentDataForEvaluation()` (internal)
- `GetTaskDiagnosticEvidence(AgentTaskId: BigInteger; var Diagnostics: JsonObject): Boolean` (internal)
- `ReceiveEmail(SenderEmail: Text; Subject: Text; var WorkItem: Codeunit "PA Work Item"): Boolean` (internal)
- `ReceiveUpload(FileName: Text; var WorkItem: Codeunit "PA Work Item"): Boolean` (internal)
- `SetWorkItemOutcomeForTest(WorkItemId: Guid; OutcomeId: RecordId)` (internal)
- `LoadConfiguration(var PASetupUpdateParameters: Codeunit "PA Setup Update Parameters"; CreateAgentUser: Boolean)` (internal)
- `SetEmailMonitoring(var PASetupUpdateParameters: Codeunit "PA Setup Update Parameters"; MonitorEmail: Boolean; EmailAccountId: Guid; ReviewPolicy: Enum "PA Email Review Policy")` (internal)
- `Reset()` (internal)

Plus 15 local procedures.

## Calls

From the extracted call graph of BC30 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 3341 "PA Work Item"](../codeunit/3341.md) (18 calls: `GetNativeInfotipSources → GetAgentTaskId`, `GetNativeInfotipSources → GetOutcome`, `GetTaskDiagnosticEvidence → GetId`, …)
- [Codeunit 3321 "PA Setup Update Parameters"](../codeunit/3321.md) (7 calls: `LoadConfiguration → InitializeFromStoredSetup`, `LoadConfiguration → SetSkipAgentConfiguration`, `LoadConfiguration → SetSkipEmailVerification`, …)
- [Codeunit 3343 "PA Setup"](../codeunit/3343.md) (7 calls: `Reset → ApplySetup`, `Reset → DeleteSetup`, `Reset → LoadOrCreateSetup`, …)
- [Codeunit 3339 "PA V1V2 Flag"](../codeunit/3339.md) (5 calls: `GetTaskDiagnosticEvidence → GetVersion`, `GetWorkItemInfotipSources → GetVersion`, `PrepareEvaluationVersion → IsV2Active`, …)
- [Codeunit 3347 "PA Draft Based Test Fixtures"](../codeunit/3347.md) (5 calls: `DeleteAllTaskAndEDocumentDataForEvaluation → DeleteAllEDocumentDataForEvaluation`, `GetTaskDiagnosticEvidence → BuildProposedPurchaseInvoice`, `GetWorkItemInfotipSources → GetWorkItemInfotipSources`, …)
- [Codeunit 3344 "PA Setup Update"](../codeunit/3344.md) (2 calls: `EnsureActivatedAndReceivePdf → EnsureActivated`, `Reset → Update`)
- [Codeunit 3314 "PA Agent Task Execution"](../codeunit/3314.md) (1 call: `GetCreateVendorSuggestionCode → GetAgentTaskUserInterventionSuggestions`)
- [Codeunit 3345 "PA Work Item Intake"](../codeunit/3345.md) (1 call: `EnsureActivatedAndReceivePdf → ReceivePdf`)

## Recent changes

- 2026-11-23 [#14327 Expose Payables Agent infotip sources through test fixtures](../../changes/bcapps/14327.md) (main, BC30, feature)
- 2026-11-14 [#13361 Foundation for Payables Agent V2.0](../../changes/bcapps/13361.md) (main, BC30, refactor, added)

## Across versions

- Present in: BC30
- Changed (declaration) in: none

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Write agent tests](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/ai-test-copilot-agent-tests) — possibly related: Test fixtures support writing agent tests for the Payables Agent using the AI Test Suite framework. (model-linked)

## Deprecations

- procedure IsV2PreviewSelected: guarded (#if not CLEAN30)
- procedure SetV2PreviewSelected: guarded (#if not CLEAN30)

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC30 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "PA Test Fixtures")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
