---
id: change/bcapps/11740
type: change
title: "#11740 Bug 636971: [Expense Agent] EA Scheduler Task table grows unbounded with no cleanup or UI visibility"
summary: The Expense Agent now calls an existing cleanup function so that the EA Scheduler Task table no longer grows without limit.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit ea agent dispatcher
  - codeunit ea agent scheduler
system: copilot
review:
  state: reviewed
  by: opus
  at: "2026-10-17T01:12:12.701Z"
  flags: []
generated:
  at: "2026-10-24T01:02:25.817Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: cd077aa86c52056f8fa4b9bf088fa80f23774f7d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11740
    title: "microsoft/BCApps#11740: Bug 636971: [Expense Agent] EA Scheduler Task table grows unbounded with no cleanup or UI visibility"
    date: "2026-10-09"
    commit: cd077aa86c52056f8fa4b9bf088fa80f23774f7d
    t: null
    quote: Added Call to existing cleanup function.
links:
  learn: []
  objects:
    - object/codeunit/6938
    - object/codeunit/6935
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-task-scheduler
      title: Task scheduler
      label: possibly related
      why: Documents task scheduler for background execution and failure handling relevant to EA Scheduler Task management.
      by: model
number: 11740
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11740
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-09T16:40:36Z"
author: BardurKnudsen
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 2
  deletions: 3
  al: 2
apps:
  - ExpenseAgent
objects_touched:
  - key: codeunit/6938
    page: codeunit/6938
    type: codeunit
    id: 6938
    name: EA Agent Dispatcher
    app: ExpenseAgent
    status: modified
  - key: codeunit/6935
    page: codeunit/6935
    type: codeunit
    id: 6935
    name: EA Agent Scheduler
    app: ExpenseAgent
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 636971
systems:
  - copilot
quote: Added Call to existing cleanup function.
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #11740 Bug 636971: [Expense Agent] EA Scheduler Task table grows unbounded with no cleanup or UI visibility

> The Expense Agent now calls an existing cleanup function so that the EA Scheduler Task table no longer grows without limit.

[Pull request](https://github.com/microsoft/BCApps/pull/11740) · merged into `main` (BC30) on 2026-10-09 by BardurKnudsen · 2 files (+2 -3), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Adds a call to an existing cleanup function in the Expense Agent integration code
- Stops EA Scheduler Task records from piling up indefinitely
- Small change across the EA Agent Dispatcher and EA Agent Scheduler codeunits
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 6938 "EA Agent Dispatcher"](../../objects/codeunit/6938.md), ExpenseAgent: modified
- [Codeunit 6935 "EA Agent Scheduler"](../../objects/codeunit/6935.md), ExpenseAgent: modified

## Context

- Work items: AB#636971
- Labels: AL: Apps (W1), Team: Finance
- Systems: copilot
- From the description: "Added Call to existing cleanup function."

## Possibly related

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

- [Task scheduler](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-task-scheduler) — possibly related: Documents task scheduler for background execution and failure handling relevant to EA Scheduler Task management. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
