codeunitCopilot & Agentsofficial - Microsoftderived - from the source, no model text

Codeunit 3307 "Payables Agent Setup"

PayablesAgent · Microsoft.Agent.PayablesAgent

Across versions

  1. BC23-28not present
  2. BC29-30present

Neighbourhood 24 connected objects and pages

Codeunit 3304 "PA Setup Configuration" (calls, 20 links)PA Setup ConfigurationCodeunit 3303 "Payables Agent" (calls, 7 links)Payables AgentPage 3304 "Payables Agent Setup" (calls, 5 links)Payables Agent SetupPage extension 3309 "PA Purchase Invoice List" (calls, 5 links)PA Purchase Invoice ListCodeunit 152 "User Permissions" (calls, 3 links)Codeunit 3316 "PA Events" (calls, 3 links)PA EventsCodeunit 3305 "Payables Agent Upgrade" (calls, 2 links)Payables Agent UpgradeCodeunit 3310 "PA Validate Setup" (calls, 2 links)PA Validate SetupCodeunit 3318 "PA Trial" (calls, 2 links)PA TrialCodeunit 4321 "Agent" (calls, 2 links)Codeunit 4324 "Agent Setup" (calls, 2 links)Agent SetupCodeunit 7773 "Copilot Capability" (calls, 2 links)Copilot CapabilityCodeunit 8347 "Feature Configuration" (calls, 2 links)Feature ConfigurationCodeunit 8904 "Email Message" (calls, 2 links)Email MessageCodeunit 9024 "Azure AD Graph User" (calls, 2 links)Azure AD Graph UserPage 3313 "PA Known Senders" (calls, 2 links)PA Known SendersPage extension 3305 "AgentTaskList" (calls, 2 links)Codeunit 1266 "Cryptography Management" (calls)Codeunit 2200 "Azure Key Vault" (calls)Codeunit 3309 "PA Demo Guide" (calls)Codeunit 3317 "Payables Agent OCV" (calls)Codeunit 4317 "Agent System Permissions" (calls)Codeunit 457 "Environment Information" (calls)Page 3307 "PA Demo Guide" (calls)

Open in the neighbourhood explorer

One hop out, from the extracted relations and call graph. Up to 40 shown; the sections below list them all.

PayablesAgent · Microsoft.Agent.PayablesAgent · BC29-30 · source at ea08af5e · facts from BC29

Properties

Property Value
Access Internal
Permissions tabledata “Outlook Setup” = rim, tabledata “Payables Agent Setup” = rmid, tabledata “PA Known Sender” = r

Event subscriptions

  • HandleOnAfterCreatedNewCompanyByCopyCompany subscribes to Report “Copy Company” OnAfterCreatedNewCompanyByCopyCompany

Procedures

  • LoadSetupConfiguration(var PASetupConfiguration: Codeunit "PA Setup Configuration"): Retrieves all the records containing setup information for the payables agent.
  • ApplyPayablesAgentSetup(var PASetupConfiguration: Codeunit "PA Setup Configuration"): Persist the payables agent setup configured across the different records and applies the necessary actions like activating and monitoring mailboxes. This is executed both when activating and deactivating the agent.
  • GetOrCreateAgentEDocumentService(): Record "E-Document Service"
  • WasEDocumentCreatedByAgent(EDocument: Record "E-Document"): Boolean
  • GetAgent(var Agent: Record Agent): Boolean: Retrieves the agent record if configured in the database, and ensures that the Payables Agent setup record is updated with the correct user security id.
  • GetAgent(var Agent: Record Agent; UpdateSetup: Boolean): Boolean: Retrieves the agent record if configured in the database, and optionally ensures that the Payables Agent setup record is updated with the correct user security id.
  • SetAgentInstructions(AgentUserSecurityId: Guid) (internal)
  • IsAgentDrivenLineMatchingEnabled(): Boolean (internal): Feature-specific resolver for the agent-driven line-matching experiment, used to select the prompt variant.
  • EnsureAgentInstructionsMatchConfiguration(AgentUserSecurityId: Guid) (internal): Reconciles the agent’s persisted instructions with the current experiment configuration. The agent instructions are set once (at creation/upgrade), but tenant-level ECS experiments can change independently; this reapplies the instructions when the configuration that produced them has drifted. Cheap …
  • TryEnsureAgentInstructionsMatchConfiguration(AgentUserSecurityId: Guid) (internal): Non-throwing wrapper around EnsureAgentInstructionsMatchConfiguration for callers on a critical path (e.g. the e-document import event subscriber) where an instruction-refresh failure must not abort the host operation. Returns false on failure so the caller can log and continue with existing instruc…
  • GetInstructionsConfigHash(): Text (internal): Fingerprint of every tenant-level experiment configuration that influences the agent’s instructions. Generic on purpose: a future prompt-affecting experiment only needs its key added to GetInstructionsExperimentKeys (and its value consumed in prompt selection) — no new setup field required.
  • CanShowAgentActions(): Boolean (internal)
  • InsertAccessControlForEligibleUsers(AgentUserSecurityId: Guid) (internal)
  • AllowCreateNewAgent(): Boolean (internal): Returns true if a new Payables Agent can be created. Blocked if an agent already exists. Otherwise allowed for SUPER users or any user who has created a posted purchase invoice.
  • AgentUserName(): Code[50] (internal)
  • AgentDisplayName(): Text[80] (internal)
  • AgentSummary(): Text (internal)
  • EnsureAgentActivated(var AlreadyActivated: Boolean) (internal): Ensures the agent is activated. If the agent does not exist, it is activated silently with trial mode initialized if eligible. Email monitoring is not enabled.
  • GetDefaultProfile(var TempAllProfile: Record "All Profile" temporary) (internal)
  • GetDefaultAccessControls(var TempAccessControlBuffer: Record "Access Control Buffer" temporary) (internal)
  • FeatureName(): Text (internal)
  • HasUserCreatedPostedPurchInvoice(): Boolean (internal): Computes is the session user has created a purchase invoice in the past 30 days. This is used as a heuristic to determine if the user should be allowed to setup the agent.
  • GetUsersThatHaveCreatedPostedPurchInvoice(): List of [Guid] (internal): Returns the list of user security IDs that have created posted purchase invoices in the past 30 days. This is used as a heuristic to determine which users should be given access to the agent.
  • ImportInvoiceFile(FileName: Text; InStream: InStream): Creates an E-Document from an uploaded invoice file and triggers agent processing.
  • ShouldRequestReview(EDocument: Record "E-Document"): Boolean: Decides whether an incoming e-document’s agent task must be reviewed by a human, based on the configured review policy, the monitored folder, sender authentication (compauth / internal), and the known-senders list.
  • IsSenderRejected(EDocument: Record "E-Document"): Boolean: Returns true when the sender of the e-document is configured with the Reject policy, meaning no agent task should be created for it.
  • IsSenderAuthenticated(EDocument: Record "E-Document"): Boolean: Returns true when the sender of the e-document’s source email can be trusted as authenticated: either composite authentication passed (compauth=pass), or the message originated inside the organization (see IsSenderInternal). Missing email or headers yields false.
  • IsSenderInternal(EDocument: Record "E-Document"): Boolean: Returns true when the e-document’s source email was stamped by Exchange as originating inside the organization (X-MS-Exchange-Organization-AuthAs = Internal). This covers intra-tenant mail (e.g. same onmicrosoft.com domain), which is not stamped with compauth. Exchange re-stamps this header on inbou…
  • CompAuthPassed(AuthenticationResults: Text): Boolean: Returns true when an Authentication-Results header value indicates compauth=pass.
  • ClassifyKnownSendersUnusedByChange(NewPolicy: Enum "PA Email Review Policy"; NewMonitoredFolder: Text; var KnownSendersCount: Integer): Enum "PA Setup Change Impact": Classifies whether a pending setup change would leave the known-senders list unused. Returns None when nothing curated would be ignored (including when the list is empty).
  • ClassifyKnownSendersUnusedReason(SavedPolicy: Enum "PA Email Review Policy"; SavedMonitoredFolder: Text): Enum "PA Setup Change Impact": Classifies why the known-senders list is currently unused in a saved setup, regardless of whether the list has entries. Used by the Known Senders page to surface a notification.
  • PolicyLabel(Policy: Enum "PA Email Review Policy"): Text: Returns the user-facing label for an “Email Review Policy” value, for interpolation into messages.

Plus 8 local procedures.

Calls

From the extracted call graph of BC29 (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.

Called by

Recent changes

Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 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: "Payables Agent Setup"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.

Evidence 1 sources