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

Codeunit 4303 "Agent Task"

System Application · System.Agents

Across versions

  1. BC23-24not present
  2. BC25added
  3. BC262 procedures added, 1 procedures removed
  4. BC276 procedures added, 2 procedures changed
  5. BC2811 procedures added
  6. BC293 procedures changed, 3 procedures added
  7. BC30unchanged

Neighbourhood 2 connected objects and pages

Codeunit 4300 "Agent Task Impl." (calls, 14 links)Agent Task Impl.Page 4362 "Agent Task Log Entry Instr" (calls)Agent Task Log Entry Instr

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.

System Application · System.Agents · BC25-30 · source at ea08af5e · facts from BC29

Procedures

  • TaskExists(AgentUserSecurityId: Guid; ExternalId: Text): Boolean Δ BC27: Check if a task exists for the given agent user and conversation
  • GetTaskByExternalId(AgentUserSecurityId: Guid; ExternalId: Text): Record "Agent Task" + BC27: Get the task for the given agent user and external ID.
  • SetStatusToReady(AgentTaskID: BigInteger) + BC26 Δ BC27 + BC28 Δ BC29: Set the status of the task to ready if the task is in the state that it can be started again. The agent task will be be picked up for processing shortly after updating the status.
  • SetStatusToReady(var AgentTask: Record "Agent Task") + BC26 Δ BC27 + BC28 Δ BC29 (obsolete 29.0: Use the overload that takes AgentTaskID instead.): Set the status of the task to ready if the task is in the state that it can be started again. The agent task will be be picked up for processing shortly after updating the status.
  • CanSetStatusToReady(AgentTaskID: BigInteger): Boolean + BC26 + BC28: Checks if the task can be set to ready and started again.
  • CanSetStatusToReady(AgentTask: Record "Agent Task"): Boolean + BC26 + BC28: Checks if the task can be set to ready and started again. The record is not retrieved again; the caller must ensure the record is up to date.
  • StopTask(AgentTaskID: BigInteger; UserConfirm: Boolean) + BC27 + BC28 Δ BC29: Stops the agent task.
  • StopTask(var AgentTask: Record "Agent Task"; UserConfirm: Boolean) + BC27 + BC28 Δ BC29 (obsolete 29.0: Use the overload that takes AgentTaskID instead.): Stops the agent task.
  • RestartTask(AgentTaskID: BigInteger; UserConfirm: Boolean) + BC27 + BC28 Δ BC29: Restarts the agent task by setting its status to ready.
  • RestartTask(var AgentTask: Record "Agent Task"; UserConfirm: Boolean) + BC27 + BC28 Δ BC29 (obsolete 29.0: Use the overload that takes AgentTaskID instead.): Restarts the agent task by setting its status to ready.
  • IsTaskRunning(AgentTaskID: BigInteger): Boolean + BC27 + BC28: Checks if the agent task is currently running.
  • IsTaskRunning(var AgentTask: Record "Agent Task"): Boolean + BC27 + BC28: Checks if the agent task is currently running. The record is not retrieved again; the caller must ensure the record is up to date.
  • IsTaskCompleted(AgentTaskID: BigInteger): Boolean + BC27 + BC28: Checks if the agent task is completed.
  • IsTaskCompleted(var AgentTask: Record "Agent Task"): Boolean + BC27 + BC28: Checks if the agent task is completed. The record is not retrieved again; the caller must ensure the record is up to date.
  • IsTaskStopped(AgentTaskID: BigInteger): Boolean + BC27 + BC28: Checks if the agent task is stopped (by user or system).
  • IsTaskStopped(var AgentTask: Record "Agent Task"): Boolean + BC27 + BC28: Checks if the agent task is stopped (by user or system). The record is not retrieved again; the caller must ensure the record is up to date.
  • GetCopilotCreditsConsumed(AgentTaskID: BigInteger): Decimal + BC28 (obsolete 29.0: Use the methods in the “Agent Consumption Overview” codeunit instead.): Gets the total Copilot credits consumed by the agent task.
  • GetLogEntryDetails(var AgentTaskLogEntry: Record "Agent Task Log Entry"): Text + BC28: Gets the details for the specified agent task log entry.
  • GetStepsDoneCount(AgentTaskID: BigInteger): Integer + BC29: Gets the number of steps done for the specified agent task.
  • OpenAgentTaskLogEntries(AgentTaskID: BigInteger) + BC29: Opens the agent task log entries page for the specified agent task.
  • ArchiveTask(AgentTaskID: BigInteger; UserConfirm: Boolean) + BC29: Archives the agent task.
  • GetModelId(AgentTaskID: BigInteger): Code[30] + BC28: Gets the model ID of the agent task.
  • GetModelName(AgentTaskID: BigInteger): Text[70] + BC28: Gets the model name of the agent task.

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.

  • Codeunit 4300 “Agent Task Impl.” (14 calls: ArchiveTask → ArchiveTask, CanSetStatusToReady → CanAgentTaskBeSetToReady, GetLogEntryDetails → GetDetailsForAgentTaskLogEntry, …)

Called by

Deprecations

  • procedure GetCopilotCreditsConsumed: Pending 29.0 (#if not CLEAN29), “Use the methods in the “Agent Consumption Overview” codeunit instead.”
  • procedure RestartTask: Pending 29.0 (#if not CLEAN29), “Use the overload that takes AgentTaskID instead.”
  • procedure SetStatusToReady: Pending 29.0 (#if not CLEAN29), “Use the overload that takes AgentTaskID instead.”
  • procedure StopTask: Pending 29.0 (#if not CLEAN29), “Use the overload that takes AgentTaskID instead.”

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 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: "Agent Task"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.

Evidence 1 sources